win32单例执行

时间:2020-06-26 19:59:45   收藏:0   阅读:71
 1 BOOL IsAlreadyRun()
 2 
 3 {
 4 
 5     HANDLE hMutex  = NULL;
 6             hMutex = ::CreateMutex(NULL,FALSE,"Application");
 7             if(hMutex)
 8            {
 9                 if(ERROR_ALREADY_EXIST==::GetLastError())
10                 {
11                     return TRUE;
12                  } 
13             }
14             return FALSE;
15 }
16 
17        

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!