键盘挂钩问题 [英] Keyboard hooking problem

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

问题描述

大家好,

我正在使用设置的Windows密钥挂钩制作密钥记录器.我陷入了一个怪异的钩子问题.

当我尝试在记事本中输入内容或类似的内容时,我的代码运行良好,但是每当我在Internet上(例如在地址栏中)输入内容或聊天时,每个字符都会重复两次.

我已经调试了代码,并知道Windows密钥挂钩发送了两次消息,以防万一我在Internet浏览器上键入内容.

那么,为什么在Internet情况下两次发送该消息?有人对此有任何线索吗?

Hi everyone,

I am making a key logger using the set Windows key hook. I have been stuck in a weird problem with the hooks.

My code is working fine when I try typing in notepad or any thing like that, but whenever I type something on the Internet i.e. in the address bar or chatting every character is repeated twice.

I have debugged the code and get to know that Windows key hook is sending the message twice in case I am typing on the Internet browsers.

So why is it sending the message twice in case of the Internet? Does anybody have any clue regarding this?

It would be very helpful for me.

推荐答案

检查键盘挂钩过程中的代码参数是否为HC_ACTION.
仅在代码为HC_ACTION时进行处理.
Check if the code parameter in the keyboard hook procedure is HC_ACTION.
Do the processing only if code is HC_ACTION.


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

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