Whats the function i should look for if i wan to check if a similar program is alreadi running ?
ETC: i run program A, and i click A.exe again, i wan program A to auto restore instead of running another A again.
Whats the function i should look for if i wan to check if a similar program is alreadi running ?
ETC: i run program A, and i click A.exe again, i wan program A to auto restore instead of running another A again.
/* Have a nice day */
You can do it pretty easily with a Mutex. Something like this should do the trick:
Code:if(CreateMutex(NULL, FALSE, pClassName) && (GetLastError() == ERROR_ALREADY_EXISTS)) { SetForegroundWindow(FindWindow(pClassName, NULL)); // ExitProcess or whatever }
"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers