65,179
社区成员




DWORD WINAPI InitClass(HINSTANCE hInst, DWORD flags)
HANDLE hMutexOneInstance = ::CreateMutex(NULL, false, _T("ONCE"));
bool AlreadyRunning = (::GetLastError() == ERROR_ALREADY_EXISTS ||
::GetLastError() == ERROR_ACCESS_DENIED);
if(hMutexOneInstance)
{
::CloseHandle(hMutexOneInstance);
}
if(AlreadyRunning)
{
...
return true; //退出
}