德尔福键盘挂钩 [英] Delphi Keyboard Hook

查看:36
本文介绍了德尔福键盘挂钩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在实现全局键盘挂钩时遇到了一个有趣的问题.

I'm having an interesting problem implementing a global keyboard hook.

我写了一个用于设置钩子的dll,然后是一个加载dll并处理钩子结果的应用程序(Delphi).这是今天下午在我工作的 PC 上完成的,经过一些测试后,我认为它 100% 工作.

I wrote a dll which is used to set the hook and then an application (Delphi) which loads the dll and processes the results of the hook. This was done this afternoon on my PC at work and after some testing I figured it was working 100%.

我刚刚在家里测试了相同的应用程序和 dll,没有出现任何错误,但该应用程序似乎也没有获取任何数据.

I've just tested the same app and dll here at home and I'm not getting any errors, but the application does not appear to be getting any data either.

两台机器都是WinXP,虽然我的工作机器是SP2,这台是SP3.

Both machines are WinXP, although my work machine is SP2 and this one is SP3.

Win32 API 是否有一些更改会导致此功能出现故障,或者问题可能与最近发布的某些 A/V/间谍软件/MS 更新有关?

Has there been some change in the Win32 API which would cause this to malfunction, or could the problem be related to some A/V / Spyware / MS Update that has been released recently?

我希望这里有人会在我花费数小时调试之前知道这可能发生的明显原因.

I'm hoping somebody here will know of an obvious reason that this may happen before I spend hours debugging.

谢谢!

推荐答案

实际上有些 A/V 不喜欢自制的钩子.我在某些机器上的鼠标钩子也有同样的问题,它不依赖于服务包版本.

Actually some A/Vs don't like homemade hooks. I've got the same problem with my mouse hooker on some machines, and it doesn't depend on service pack version.

这篇关于德尔福键盘挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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