I'm looking for a asm routine that avoid multiple instances of a program. I need to start a application only one time. My idea was to create a program that read the command line parameters and launch it with a winexecute api call checking the instance before.
Posted on 2001-07-31 19:09:58 by Edinando
Posted on 2001-07-31 19:46:22 by Soul~Drudge
Maybe you can use this method:

At the begining of the program, you can call CreateMutex with
the first parameter NULL, the second parameter FALSE, and
the third with a pointer to the string with the name of your
mutex.

Then you look at the return value. If is NULL, you call GetLastError
and if you get ERROR_ALREADY_EXISTS, *the mutex already
exists*, another instance of your program is runing. If you get
NULL, CreateMutex has failled :(. Otherwise, you got the mutex
handle.
Posted on 2001-07-31 23:13:42 by n u M I T_o r