CreateMutex(NULL,TRUE,_T("PreventSecondInstance"))//有什么具体含义吗?
bool bFound = false;m_hMutexOneInstantance=CreateMutex(NULL,TRUE,_T("PreventSecondInstance"));if(GetLastError()==ERROR_ALREADY_EXISTS) bFound=TRUE;if(m_hMutexOneInstantance) ReleaseMutex(m_hMutexOneInstantance);if (bFound==TRUE){ ::AfxMessageBox("已经有一个程序在运行"); return false;}