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

2009-03-18 Thread Fantomas
Thank you all for the useful info. In view of aforesaid named objects seem to be the simplest and the most reliable way to pevent running multiple instances af an application under Win32/ -- Best regards, Fantomas ___ fpc-pascal maillist - fpc-pascal

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

2009-03-18 Thread Luca Olivetti
En/na leledumbo ha escrit: Is it the same technique used by http://wiki.lazarus.freepascal.org/UniqueInstance UniqueInstance ? No, UniqueInstance uses an IpcServer/IpcClient, so it is cross-platform. Bye -- Luca ___ fpc-pascal maillist - fpc-pasc

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

2009-03-18 Thread leledumbo
Is it the same technique used by http://wiki.lazarus.freepascal.org/UniqueInstance UniqueInstance ? -- View this message in context: http://www.nabble.com/Windows-find-out-if-an-application-already-is-running-tp22526930p22577639.html Sent from the Free Pascal - General mailing list archive at

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

2009-03-18 Thread Frank Peelo
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 m

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

2009-03-16 Thread Fantomas
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

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

2009-03-15 Thread Rainer Stratmann
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 th

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

2009-03-15 Thread 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 r

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

2009-03-15 Thread Rainer Stratmann
I tried system.hprevinst, but this shows always 0. If there are more copys of the program then hinstance is always the same value. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal