BOOL CHungDlg::ProcessRunStatus(HWND hwnd)
{
HINSTANCE hDll = LoadLibrary(_T("user32.dll"));
if (NULL != hDll)
{
typedef BOOL(WINAPI *PROCISHUNGAPPWINDOW)(HWND);
PROCISHUNGAPPWINDOW IsHungAppWindow = (PROCISHUNGAPPWINDOW)GetProcAddress(hDll, "IsHungAppWindow");
if (IsHungAppWindow(hwnd))
{
MessageBox("未响应");
CloseApp(hwnd);// 结束进程
return FALSE;
}
else
{
MessageBox("正在运行");
return TRUE;
}
}
return FALSE;
}
根据窗口句柄判断程序运行状态
于 2013-12-13 09:51:34 首次发布