Today, I saw two articles on MSN's core discussion group. The question is whether the application is unresponsive. The original text is as follows:
> How are it possible to determine a process is ' not responding ' like NT Task
> Manager do?
The heuristic works is for GUI processes, and consists of calling
SendMessageTimeout () with Smto_abortifhung.
>there are any APIs call to doing job, or this status is simply a deduction
>based on process counters, like so 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.
--
There is a rational reason. Of course, I also have a undocumented function here, but other solutions, NT and 9X have a USER32.DLL function, Ishungappwindow (NT) and Ishungthread (9X). It's easy to use. The following is a prototype.
BOOL Ishungappwindow (
HWND hwnd,//Handle to main app ' s window
);
BOOL Ishungthread (
DWORD dwThreadID,//The thread ' s identifier of the main app ' s window
);
With the prototype, even the explanation is not necessary, good not.:) However, the call requires GetProcAddress. The function is not in the library.