如何使用Hook销毁键盘消息? [英] How to destroy a keyboard message using Hook?

查看:116
本文介绍了如何使用Hook销毁键盘消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想使用键盘钩破坏消息,例如我想破坏事件在EditBox(MFC)中按"a",而不是从此EditBox的键盘中按"a",如何执行此操作?请帮我.在此先谢谢您.

Hi all,
I want to use a keyboard hook to destroy a message, example I want to destroy event press ''a'' in EditBox (MFC), not allow to press ''a'' from keyboard in this EditBox, how to do this? Please help me. Thank in advance.

推荐答案

您不需要挂钩就可以过滤进入编辑器控件的事件(因为这是MFC,您的意思是CEdit吗?).您可以完成所有处理消息的操作.
请参见以下示例:
http://support.microsoft.com/kb/92394 [
You don''t need a Hook to filter events coming to a editor control (as this is MFC, did you mean CEdit?). You can do it all processing messages.
Please see this example:
http://support.microsoft.com/kb/92394[^].

—SA


您还可以使用带掩码的编辑控件(例如 COXMaskedEdit [
You could also achieve this with a masked edit control, such as CMFCMaskedEdit[^] or maybe COXMaskedEdit[^].


这篇关于如何使用Hook销毁键盘消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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