#pragma comment(linker, "/subsystem:"windows" /entry:"mainCRTStartup"") HANDLE hMutex = CreateMutexA(NULL, true, "XXX_0D0DDD11-5E3F-4287-BB74-7E3D2C7720EF"); if (hMutex) { if (GetLastError() == ERROR_ALREADY_EXISTS) { //std::cerr << "Program already run... " // << "Press any key to exit..." << std::endl; //std::cin.get(); return 1; } } else { return 1; }