How can I check the running processes in Windows with C++, so that I can avoid running my application again when I double click it several times. Thanks.
Usually the issue of lounching an aplication only once is handled by the call to CreateMutex function in the initialization code of your main window. After this call, if the GetLastError API function returns ERROR_ALREADY_EXISTS this means that there is a previous instance of your application.
HTH, s-)
Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
...additionally , if it is window application - use FindWindow API function and when user click twice the same executate - activate the existing application using the returned window handler ( it is one of the principles of usability)
Issahar Gourfinkel
senior software engineer
Softwatch LTD
Israel
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.