今天图老师小编给大家展示的是确定一个应用程序是否没有响应,精心挑选的内容希望大家多多支持、多多分享,喜欢就赶紧get哦!
【 tulaoshi.com - 编程语言 】
今天在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
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)Manager does to determine this AFAIK.
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)--
有理有理.当然,我这里还有一个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.库里没有该函数.
来源:http://www.tulaoshi.com/n/20160219/1609254.html
看过《确定一个应用程序是否没有响应》的人还看了以下文章 更多>>
如果您有什么好的建议或者疑问,可以联系我们。 商务合作QQ:3272218541;3282258740。商务合作微信:13319608704;13319603564。
加好友请备注机构名称。让我们一起学习、一起进步tulaoshi.com 版权所有 © 2019 All Rights Reserved. 湘ICP备19009391号-3
微信公众号