如何挂钩按键事件在Word共享加载? [英] How to hook keypress event in a Word shared add-in?
问题描述
我需要能够得到它们传递到Word文档之前的所有按键事件。我想要做的键的特殊处理,并根据在该加载是在什么模式,键可以或可以不被发送到Word文档。我只想要属于文档的按键事件,我不想挂机弹出窗口或其他对话框的事件。
I need to be able to get all keypress events before they are passed up to the Word document. I want to do special handling of the keys and depending on what mode the add in is in, the keys may or may not be sent to the Word document. I only want the keypress events that belong to the document, I don't want to hook events for popup windows or other dialog boxes.
我已经读一些有关智能标记,但不知道他们是如何工作的。
I have read something about smart tags, but don't know how they work.
如果我有子类文档窗口,我怎么能得到窗口句柄?
If I have to subclass the document window, how can I get the window handle?
推荐答案
使用SetWindowsHookEx函数(WH_KEYBOARD_LL,......听按键。
use SetWindowsHookEx( WH_KEYBOARD_LL, ... to listen to keystrokes.
这篇关于如何挂钩按键事件在Word共享加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!