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 IamaSherpa 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
 
Here an example
===========================================================
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
int Mutex;
Mutex= (int) CreateMutex(NULL,true,GetPrevInstMutexName()); // Check if an Instance of the Programm running
if((Mutex != NULL) && (GetLastError()==0)) //if not start Program
{
try
{
Application->Initialize();
.
.
-
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
==========================================================

This code has to be inserted into your file
Projectname.cpp

hnd
hasso55@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top