I have to port a Windows CE application to Windows XP.
In Windows CE this application runs fine. It contains a lowlevelkeyboardproc that is called when a key is pressed.
The different Windows CE projects are build with several makefile-, sources- & *.def- files.
I build new projects with Visual Studio 2010 and added the *.cpp & *.h files.
Further there has been some Windows CE specific stuff in the code, which I replaced thru Windows XP stuff.
Concerning the lowlevelkeyboardproc I changed nothing in the existing Windows CE code.
The lowlevelkeyboardproc stuff is implemented in a service (*.exe) and a DLL.
The service loads the DLL. The DLL is the part that contains the hook function.
1. Inside the service a thread is create. Concerning the lowlevelkeyboardproc the following stuff is done in this thread:
---------------------------------------------------------------------------------------------------------------------------
2. the lowlevelkeyboardproc related stuff in my MyHook.dll is:
---------------------------------------------------------------------------------------------------------------------------
1. Can somebody see, why MyLowLevelKeyboardHook is never called in Windows XP, when a key has been pressed?
2. I tried a lot of stuff to get my Hook installed.... I read a lot in the MSDN about Hooks &
especially lowlevelkeyboardproc etc... I searched in old forum threads for a solution. ...
But I wasn't able to fix the problem. My hook still isn't called.
==> Can somebody tell me please all the important points, that are required to
get a own lowlevelkeyboardproc global hook working.
3. Does somebody know a good link(s) to a place(s), that explains everything about this topic?
4. Does somebody know a good link(s) to a place(s), with a good free sample code?
I set the check box "Allow service to interact with desktop" and now the keyboard hook is called.
But unfortunately the unhandled exception "privileged instruction" is thrown, after leaving the keyboard hook function.
Even with a total empty keyboard hook function, this error occurs: