Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check running processes in Windows

Status
Not open for further replies.

gzlzj

Technical User
Nov 17, 2001
6
US
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.


Jeff
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top