반응형 CreateMutex1 [개발/MFC] 중복실행 방지하기 [개발/MFC] 중복실행 방지하기 TCHAR szAppName[] = _T("sbrich"); HANDLE hMutex = NULL; bool IsSecondInstance() { bool isSecondInstance= false; hMutex= CreateMutex(NULL, NULL, szAppName); int iLastError = GetLastError(); if(hMutex && (ERROR_ACCESS_DENIED == iLastError || ERROR_ALREADY_EXISTS == iLastError)) { ReleaseMutex(hMutex); hMutex= NULL; isSecondInstance= true; } return isSecondInstance; } int main() .. 2011. 9. 20. 이전 1 다음 반응형