函数-判断程序是否运行
作者:互联网
/// <summary> /// 判断是否重复运行 /// </summary> /// <returns>FALSE 没运行,TRUE 已运行</returns> BOOL IsAlreadyRun() { HANDLE hMutex = NULL; hMutex = ::CreateMutex(NULL, FALSE, "TEST"); if (hMutex) { if (ERROR_ALREADY_EXISTS == ::GetLastError()) { return TRUE; } } return FALSE; }
标签:判断,return,函数,程序,hMutex,FALSE,NULL,TRUE,运行 来源: https://www.cnblogs.com/ceovs/p/15737118.html