<b>肯定一个利用程序能否没有呼应</b>[VC/C++编程]
本文“<b>肯定一个利用程序能否没有呼应</b>[VC/C++编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
本日在MSN的核心谈论组上看到两篇文章.谈论的乃是利用程序能否没有呼应.原文以下:
> 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.库里没有该函数.
以上是“<b>肯定一个利用程序能否没有呼应</b>[VC/C++编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |