Hi
I build an application in vc++ and I want that 'one' instance of application can be runned,in a time .that means that when I run the application, then any instance of this application can't be run in that time.
How can do this?
/* In real code, this should be a unique identifier */
#define MUTEX_NAME "MYPROGRAM"
int main(void)
{
CreateMutex(NULL, FALSE, MUTEX_NAME);
if (GetLastError() != 0) {
/* Instance of this program is already running */
return EXIT_FAILURE;
}
/* ... */
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.