How to have only one instance of a program running
I have a system-tray application. How to prevent it to appear many times in the system tray, in other words, if the program is already running and user starts it again from the Start menu how to stop it to inserting another icon in the system tray?
Many thanks for all/any responses.
Re: How to have only one instance of a program running
There are many different ways to make sure there is only one instance of a program. The most simple one is to call FindWindow(). Another one is CreateMutex(). Mutex is a kind of system-global object. Once you create and name it, it is up there until you close your process' or mutex's itself handle.
Good luck!
Leonid Sysoev
Re: How to have only one instance of a program running
Thanks Leonid, that saved me lot of time!
Mr Ode