My details: custom mobile device running Windows CE 4.2, Compact Framework 2.0 SP1. C# app making decent use of P/Invokes with no problems until now.
I've written a low-level keyboard hook (similar to, but not identical to, this CodeProject post) which works marvelously with one exception. One thing that our software does is allow access to Windows CE's screen-calibration functionality; this is the screen upon which you need to tap a series of targets, finally pressing Esc to cancel or Enter to accept. We call this functionality via a P/Invoke, and I think the keypress that occurs inside this Win32 API function is being interfered with by my keyboard hook.
My keyboard hook doesn't do anything intensive, and doesn't change execution flow, but I think the use of the two may be fundamentally incompatible. When I exit the debugger after running this screen, all the Enter key presses I've attempted all "hit" at once (this device makes a clicky typing noise) when the program closes. This makes me think that the hook is not properly passing the keypress into the Win32 API function the way it correctly does to a .NET application. Any thoughts?
Do you think that:
a) Keyboard hooks and keyboard-requiring P/Invokes are incompatible, or
b) my implementation of the keyboard hook is to blame, or
c) does it depend at all on the hardware manufacturer, drivers, etc?
Thanks for your help!