I have limited my application to one instance(in vc++ 6.0), if you open second time the message will display like "Another instace is already running".ok thats fine.
but if you open second time,third time the message will repeatedly display with new messagebox. I want to display one MessageBox Repeatedly same .Otherwise the user has to close the messagebox number of times that he has requested. here is the my code:-
BOOL init()
{
HANDLE mutex = CreateMutex(NULL, FALSE, "mutexname");
if(mutex == NULL)
{
return FALSE;
}
if (GetLastError() == ERROR_ALREADY_EXISTS)
{
MessageBox("Another instance is already running.");
return FALSE;
}
return TRUE;
}