Click to See Complete Forum and Search --> : How to have only one instance of a program running
Mr Ode
May 28th, 1999, 06:28 AM
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.
Leonid Sysoev
May 28th, 1999, 08:20 AM
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
Mr Ode
May 28th, 1999, 08:49 AM
Thanks Leonid, that saved me lot of time!
Mr Ode
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.