HWND hDlgExists = ::FindWindow(0,"MyDialogTitle"); // hDlgExists will be NULL if dlg is not exist.
bool bAlreadyRunning; HANDLE hMutexOneInstance = ::CreateMutex( NULL, FALSE, _T("Your_Dialog_Name")); bAlreadyRunning = ( ::GetLastError() == ERROR_ALREADY_EXISTS || ::GetLastError() == ERROR_ACCESS_DENIED); if( !bAlreadyRunning ) { // Initialize Dialog and Call DoModal() }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)