> How is it possible to determine a PRocess is "not responding" like NT Task > Manager do? The heuristic works only for GUI processes, and consists of calling SendMessageTimeOut() with SMTO_ABORTIFHUNG.
>There is any API call to do the job, or this status is simply a dedUCtion >based on process counters, like that returned from call to GetProcessTimes >API function?
Use SendMessageTimeout with a value of WM_NULL. That's all Task Manager does to determine this AFAIK.
-- 有理有理.當然,我這里還有一個UNDOCUMENTED函數,乃是其他的解決方案,NT和9X有個USER32.DLL的函數,IsHungAppWindow(NT)和IsHungThread(9X).使用起來簡便無比.下面給出原型. BOOL IsHungAppWindow ( HWND hWnd, // handle to main app's window );
BOOL IsHungThread ( DWord dwThreadId, // The thread's identifier of the main app's window ); 有了原型,連解釋都不需要,好得不的了.:)不過調用時需要GetProcAddress.庫里沒有該函數.