[fpc-pascal] Windows find out if an application already is running

Rainer Stratmann RainerStratmann at t-online.de
Sun Mar 15 21:15:48 CET 2009


that works with getlasterror = error_already_exists when try to create a 
second mutex.
thanks!

Am Sonntag, 15. März 2009 21:00 schrieb dmitry boyarintsev:
> it's better to use named mutexes (supported on all Windows versions)
> to find out if there's another instance of the app running.
>
> do the following on application start:
> - create a named mutex (constant name)
> - try to lock the mutex (0 time waiting), if failed then there's
> another instance already running.
>
> Thanks,
> Dmitry
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list