15,471
社区成员
发帖
与我相关
我的任务
分享
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;
}