| View previous topic :: View next topic |
| Author |
Message |
thomas Newbie
Joined: 15 Jan 2003 Posts: 23 Location: Germany
|
Posted: Wed Apr 02, 2003 9:07 am Post subject: task tracking |
|
|
Hello,
if it possible to track task with vds script?
I have a compiled vds-script. The problem is now, that I can start this program repeatedly, but I want that I can start this program only one time. Is it possible with vds?
Thanks
Thomas |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Apr 02, 2003 9:14 am Post subject: |
|
|
You'll need to add the following code to your script and recompile it. Add
the following to the very beginning of your script:
| Code: |
%Z = Your App Name
if @winexists(%Z)
stop
end
|
You can replace the "%Z" in the @winexists(%Z) function with the actual
title text of yor program if ya want. I would actually recommend creating
your dialog with the "CLASS" attribute naming a custom window class for
your dialog and then checking for the classname instead of the window's
title text.
| Code: |
%Z = #ClassName
if @winexists(%Z)
stop
end
|
Hope this helps.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
thomas Newbie
Joined: 15 Jan 2003 Posts: 23 Location: Germany
|
Posted: Wed Apr 02, 2003 10:10 am Post subject: |
|
|
Thanks!!
But I can not use the function @winexits, becouse my application shown no window. The EXE File is only seeable in the task manager as a task.
Another Idea? |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Apr 02, 2003 10:43 am Post subject: |
|
|
The only other thing I can think of would be to define a dialog and not to
show it. Something like this:
| Code: |
if @winexists(#MyApp)
stop
end
dialog create,My App,0,0,0,0,CLASS MyApp
rem rest of program code here...
|
I thought about recommending the "list winlist,..." command, but again without
a window it probably won't show up in the list either.
Wish there was more.
But maybe this will work out for you.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Apr 02, 2003 11:57 am Post subject: |
|
|
Try out VDSMEM.DLL. It can pass parameters between your programs so you'll be able to
set a variable in Windows memory that you can check for when starting up your prog.
As far as I remember one of the examples included with the DLL even does something
like this.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Apr 02, 2003 12:11 pm Post subject: |
|
|
Ya can try this program and see if yours shows up in the list - only
thing is, your program will prolly have the default class given to it
by VDS without a window of it's own (not sure what that is off top
of my head). This program uses LIST WINLIST with the NCI flags.
http://forum.vdsworld.com/viewtopic.php?t=1347
I'd prolly just create a window and not show it as bweckel
suggested...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Wed Apr 02, 2003 7:45 pm Post subject: |
|
|
In VDS 5, there will be something that makes finding your program much
easier when it has no dialog at all. But in the mean time, I had sent you
some code, and also see you have posted here also. All the suggestions
are about the same. You will need to create a dialog, but do not use
SHOW.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Apr 03, 2003 1:11 pm Post subject: |
|
|
what about adding an entry to the registry
and your program runs it gives it the value of 1 and when it closes, it gives it the value of 0
and whenever your program runs, it checks the value of the registry entry to see if it is already running
Serge _________________
|
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Apr 03, 2003 2:38 pm Post subject: |
|
|
| Serge wrote: | what about adding an entry to the registry
and your program runs it gives it the value of 1 and when it closes, it gives it the value of 0
and whenever your program runs, it checks the value of the registry entry to see if it is already running
Serge |
I thought about that also. But what happens then if the program crashes without writing its
exit value to the registry? Then when the user starts up the program again it will be fooled into
assuming that it is already running
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Apr 03, 2003 2:45 pm Post subject: |
|
|
good point dr dread
Serge _________________
|
|
| Back to top |
|
 |
|