[fpc-pascal] Windows find out if an application already is running
Frank Peelo
f26p at eircom.net
Wed Mar 18 11:32:29 CET 2009
Fantomas wrote:
> Hello, Rainer!
>
> Sunday, March 15, 2009, 10:22:04 PM, you wrote:
>
>
>>I tried system.hprevinst, but this shows always 0.
>>If there are more copys of the program then hinstance is always the same
>>value.
>
>
> hPrevInst does not work under Win32. It is only for Win16, AFAIK. Use a named
> mutex, as it was given, or a named event. Also, you can find a window created by
> the previous instance by its class name.
There is a technique presented at
http://www.flounder.com/nomultiples.htm
It's not in Pascal, but the same technique should work in any language.
More information about the fpc-pascal
mailing list