BOOL CEasyInterfaceApp::InitInstance()
{
HANDLE hMutex = CreateMutex(NULL, TRUE, "EasyInterFace");
if(GetLastError() == ERROR_ALREADY_EXISTS)
{
ReleaseMutex(hMutex);
CWnd *pWndPrev, *pWndChild;
if(pWndPrev = CWnd::FindWindow(NULL, "EasyInterFace"))
{
pWndChild = pWndPrev->GetLastActivePopup();
if(pWndPrev->IsIconic())
pWndPrev->ShowWindow(SW_RESTORE);
pWndChild->SetForegroundWindow();
}
return FALSE;
}
ReleaseMutex(hMutex);
}