15,473
社区成员




HANDLE hMutexA = CreateMutex(NULL,false,"MyAppMutex");
if(hMutexA == NULL)
{
cout << "fail" << endl;
}
else
{
cout << hMutexA << endl;
DWORD dwLastError = GetLastError();
if (dwLastError == ERROR_ALREADY_EXISTS )
cout << "aleady exists" << endl;
else
cout << "new one" << endl;
}