PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

WH_KEYBOARD_LL not capture all key events

WH_KEYBOARD_LL not capture all key events

I have a problem. I'm using a WH_KEYBOARD_LL hook in order to capture all system keyboard events.
I create the hook without problems, but when I want to delete it, the function unhookWindowsHookEx()
returns a FALSE (that wants to say error in the function), but the hook is correctly deleted,
because if after I create another WK_KEYBOARD_LL hook, it will be created correctly.

But my main problem is that in the LowLevelKeyboardProc (the hook process), I cannot detect
all keyboard events of all the applications of my pda pocket pc. I only detect the message
WM_KEYDOWN in a few number of keys such as: caps lock, shift, esc, and so on. And I want to detect
all keyboard events. What do you think that could be the problem?

I ask for your help, please. It's very important for me.

Here you have the declaration of the LowLevelKeyboardProc:

__declspec(dllexport) LRESULT CALLBACK LowLevelKeyboardProc (int code, WPARAM wParam, LPARAM lParam)

Create the hook:

m_hHkKeyboard = m_pfSetWindowsHook(WH_KEYBOARD_LL, LowLevelKeyboardProc, aInstance, (DWORD)NULL);

where: m_pfSetWindowsHook is a pointer to the SetWindowsHookExW function;

and delete the hook:

m_pfUnhookWindowsHook(m_hHkKeyboard)

where: m_pfUnhookWindowsHook is a pointer to the UnHookWindowsHookEx function;

I'm waiting for your answers. Thank you very much.

Sincerely,

javitobcn,