函数-判断程序是否运行
/// <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; }