采用何种办法不能同时运行两个程序
展开全部
CYourApp::InitInstance()
{
HANDLE hMutex = NULL;
hMutex = ::OpenMutex(MUTEX_ALL_ACCESS,TRUE,lpszName);
if(hMutex)
{
MessageBox(NULL,"知拦您已搭慎胡经孝弯启动程序 ! ","提示 ",MB_ICONINFORMATION);
return FALSE;
}
hMutex = ::CreateMutex(NULL,TRUE,lpszName);
... ...
}
{
HANDLE hMutex = NULL;
hMutex = ::OpenMutex(MUTEX_ALL_ACCESS,TRUE,lpszName);
if(hMutex)
{
MessageBox(NULL,"知拦您已搭慎胡经孝弯启动程序 ! ","提示 ",MB_ICONINFORMATION);
return FALSE;
}
hMutex = ::CreateMutex(NULL,TRUE,lpszName);
... ...
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询