views:

65

answers:

1

Is it possible to intercept a keystroke (and characters) sent to a window? By intercept, I mean play man-in-the-middle, instead of having just hooks onto the Window.

I'd like to filter (i.e. eliminate some keystrokes) keystrokes to a window.

+2  A: 

Use SetWindowsHookEx(). Just eliminating keystrokes can be done with a simple WH_KEYBOARD_LL hook. It is not a global hook so is easy to get right. Googles very well too.

Hans Passant
You are right. It's not a hook easy to get right. Someone actually made a DLL for this http://bobmoore.mvps.org/Win32/w32tip69.htm
MTsoul