用互斥量来判断程序是否已运行

HANDLE m_hMutex=CreateMutex(NULL,TRUE, m_pszAppName);
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
  printf("程序已经运行\r\n");
}

猜你喜欢

转载自blog.csdn.net/llxxhm/article/details/81902467