//标签:bFound,GetLastError,程序,实用,实例,TRUE,运行,hMutexOneInstantance From: https://blog.51cto.com/u_15942605/6022284
//只能运行一个实例
HANDLE hMutexOneInstantance=CreateMutex(NULL,TRUE,_T("PreventSecondInstance"));
BOOL bFound=FALSE;
if(GetLastError()==ERROR_ALREADY_EXISTS)
bFound=TRUE;
if(hMutexOneInstantance)
ReleaseMutex(hMutexOneInstantance);
if (bFound==TRUE)
{
//::AfxMessageBox("您已经运行了一个实例");
return false;
}