watchDog可偵測程式是否關閉
代码说明:
可將執行中的程式,關閉,及重開。亦可以透過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
下载说明:请别用迅雷下载,失败请重下,重下不扣分!