GetSafeHwnd(),MSG_STATUS_TOTAL,(WPARAM)&msg,0);CExitWindowsm_ExitWindows;//m_ExitWindows.Restart();m_ExitWindows.ForceReStart();}關閉程式:///關閉程式boolCWatchDogDlg::closeExeProcess(CStringprocessName){processName.MakeLower();HANDLEhSnapShot;PROCESSENTRY32pEntry;pEntry.dwSize=sizeof(pEntry);BOOLhRes;boolFound=FALSE;//GetthesnapshotofthesystemhSnapShot=CreateToolhelp32Snapshot(TH32CS_SNAPALL,NULL);//Getfirs-IMDN开发者社群-imdn.cn"> GetSafeHwnd(),MSG_STATUS_TOTAL,(WPARAM)&msg,0);CExitWindowsm_ExitWindows;//m_ExitWindows.Restart();m_ExitWindows.ForceReStart();}關閉程式:///關閉程式boolCWatchDogDlg::closeExeProcess(CStringprocessName){processName.MakeLower();HANDLEhSnapShot;PROCESSENTRY32pEntry;pEntry.dwSize=sizeof(pEntry);BOOLhRes;boolFound=FALSE;//GetthesnapshotofthesystemhSnapShot=CreateToolhelp32Snapshot(TH32CS_SNAPALL,NULL);//Getfirs - IMDN开发者社群-imdn.cn">
登录
首页 » Windows开发 » watchDog可偵測程式是否關閉

watchDog可偵測程式是否關閉

于 2022-02-16 发布 文件大小:2.34 MB
0 63
下载积分: 2 下载次数: 1

代码说明:

可將執行中的程式,關閉,及重開。亦可以透過socket連線,來偵測是否程式已死當。其相關重要功能:重開機功能://重新開機void CWatchDogDlg::setSystemReboot(){msg = "準備關機重開!";::SendMessage(this->GetSafeHwnd(),MSG_STATUS_TOTAL,(WPARAM)&msg,0);CExitWindows m_ExitWindows;//m_ExitWindows.Restart(); m_ExitWindows.ForceReStart();}關閉程式:///關閉程式bool CWatchDogDlg::closeExeProcess(CString processName){processName.MakeLower();HANDLE hSnapShot;PROCESSENTRY32 pEntry;pEntry.dwSize =sizeof(pEntry);BOOL hRes;bool Found = FALSE;//Get the snapshot of the systemhSnapShot=CreateToolhelp32Snapshot (TH32CS_SNAPALL,NULL);//Get firs

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 104269会员总数
  • 31今日下载