Hook keyboard event in word com addin
-
Is there any way to hook keyboard input as wl as mouse clicking event? Word.Application object has an event called WindowBeforeDoubleClick I am looking for similar event for keyboard. I am trying to find a way to enable a toolbar button when active document is modified. Van
-
Is there any way to hook keyboard input as wl as mouse clicking event? Word.Application object has an event called WindowBeforeDoubleClick I am looking for similar event for keyboard. I am trying to find a way to enable a toolbar button when active document is modified. Van
As i understand, you want to keep track of every keyboard action the user performs in the word document? You can always implement a local hook on the word document thread using any of the classes available here: http://www.codeproject.com/csharp/NetWin32Hooks.asp or here http://www.codeproject.com/csharp/GlobalSystemHook.asp The rest of the work you have to do is first get fmailiar with these classes (maybe you already are) and second you'd have to get the ThreadID of the desired word-document window...I know a way to do this by using the Win32 API call for FindWindowEx...you simply have to specify the name of the window (in your case "Word" and it will return the hWnd...just stick that hWnd instance to the above classes and you're hooked to the word thread :-D Let me know what happens ;)