Windows 7,SetWindowsHookEx,超过最大允许时间后停止调用回调proc [英] Windows 7, SetWindowsHookEx, callback proc stops getting called after exceeding max time allowed

查看:94
本文介绍了Windows 7,SetWindowsHookEx,超过最大允许时间后停止调用回调proc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SetWindowsHookEx设置低级鼠标挂钩时,我发现Vista和Windows 7 RC在操作上存在差异:

如果出于某种原因-CPU使用率出现随机峰值,无论-我注册了鼠标挂钩回调proc花费的时间超过了允许的最长时间,在Vista上,我的挂钩函数仍会被再次调用,在Windows 7 RC上,我的回调函数似乎再也不会被调用.

是否可以确认这是Windows 7的新预期行为?

谢谢

Ross

When setting a low level mouse hook using SetWindowsHookEx I am seeing a difference in operation between Vista and Windows 7 RC:

If, for whatever reason - random peak in CPU usage, whatever - my registered mouse hook callback proc takes longer than the maximum allowed time, on Vista my hook function will still get called again, on Windows 7 RC my callback appears never to be called again.

Can someone confirm that this is new, expected behavior for Windows 7?

Thanks

Ross

推荐答案

我无法确认是否这是Windows 7的预期行为,但我可以*确认这是Windows 7中的*新*行为.我们的应用程序挂接WH_MOUSE_LL和WH_KEYBOARD_LL,直到Windows 7调用回调都没有任何问题.现在,我们开始看到您使用Windows 7 build 7100所描述的行为,并且看起来也与RTM相似.
I can't confirm whether this is expected behavior for Windows 7, but I *can* confirm that this is *new* behavior in Windows 7.  Our app hooks WH_MOUSE_LL and WH_KEYBOARD_LL and until Windows 7 we never had any problems with our callbacks getting called.  Now we've started seeing what seems to be the behavior you describe with Windows 7 build 7100 and it looks like also with RTM.


这篇关于Windows 7,SetWindowsHookEx,超过最大允许时间后停止调用回调proc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆