MS在Windows Vista或7中是否更改了有关键盘挂钩的内容? [英] Did MS change something about keyboard hooks in Windows Vista or 7?

查看:65
本文介绍了MS在Windows Vista或7中是否更改了有关键盘挂钩的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用SetWindowsHookExWH_KEYBOARD_LL用几种语言(AutoIt,C#)实现了键盘挂钩.我也知道几个有相同问题的C ++程序.

I've implemented keyboard hooks in several languages (AutoIt, C#) using SetWindowsHookEx and WH_KEYBOARD_LL. I also know of a couple of C++ programs that have the same issue.

我没有发布任何代码,因为它们在Windows XP中可以完美运行.但是,在Windows 7下,挂钩有时会卸载"或停止处理任何其他密钥.看来这可能与内存不足有关,但是我不确定.

I didn't post any code because they work perfectly in Windows XP. However, under Windows 7, at some point the hooks become "unloaded" or stop processing any further keys. It seems like it may be related to a low memory condition, but I'm not really sure.

Microsoft是否更改了在Windows Vista或Windows 7中使用键盘挂钩的方式,以增加某些逻辑,以便在某些情况下卸载第三方挂钩?

Did Microsoft change the way keyboard hooks work in Vista or 7 to add some logic that would unload third-party hooks under certain circumstances?

相关问题:

如何重新启动鼠标钩?
检测键盘挂钩

推荐答案

好吧,在Vista中实施UAC时,已经有了很多修改.尽管如此,这并不是一个普遍的抱怨.是的,Windows很有可能停止回调挂钩回调.一项内置功能,可防止当有一个未及时处理回调的挂钩程序时操作系统无响应.它会自动从回调列表中删除,而无需任何诊断.

Well, it's been tinkered with plenty when UAC was implemented in Vista. Nevertheless, this is not a common complaint. Yes, it is quite possible for Windows to stop calling back the hook callback. A built-in feature to prevent the operating system from getting unresponsive when there is one hooker that doesn't handle the callback in a timely manner. It gets automatically removed from the callback list without any diagnostic.

这是基于超时的,并且确实会在操作系统开始运行资源不足时跳闸.就像没有足够的RAM和运行大量进程一样,获得大量分页.在更高版本的Windows中更有可能,因为它们需要更多的RAM,并且由于磁盘碎片问题(尤其是页面文件),在升级计算机而不是在安装之前清除磁盘时,它们往往会遭受损失.

This is based on a timeout and can indeed trip when the OS is starting to run low on resources. Like not having enough RAM and running lots of processes, getting massive paging. More likely with later versions of Windows since they need more RAM and tend to suffer when the machine was upgraded instead of wiped before the install due to disk fragmentation problems (especially the paging file).

可以通过添加HKCU \控制面板\桌面\ LowLevelHooksTimeout值(DWORD,例如10000)来调整超时设置.在superuser.com上询问有关此问题的更多问题

The timeout setting can be tweaked by adding the HKCU\Control Panel\Desktop\LowLevelHooksTimeout value (DWORD, say 10000). Ask more questions about it at superuser.com

这篇关于MS在Windows Vista或7中是否更改了有关键盘挂钩的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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