how do I know the message in hook procedure KeyboardProc()?
-
I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.
-
I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.
Can't you use the GetActiveWnd () inside your WM_KEYDOWN?
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
-
I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.
code_discuss wrote:
I need to know which HWND the current key down message is sent to.
will GetFocus help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
I set a keyboard hook and my KeyboardProc() get called on WM_KEYDOWN. But I need to know the message which trick the key board hook. I need to know which HWND the current key down message is sent to. The thress passed in parameters 'code, wParam, lParam' don't give me any hint.
Please ignore my last post, correct api would be
GetForegroundWindow
.."Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You