I'm trying to intercept keystrokes in a simple editor. I can display the key that is until I set the focus (click) to the window. Then function no longer works until I click outside the window again?

invoke DefWindowProc,hWnd,uMsg,wParam,lParam
.if uMsg==WM_KEYDOWN
mov eax,wParam
mov ebx,lParam
mov regXXX,eax
call DisplayregXXX
invoke SendMessage,hwndEdit,WM_SETTEXT,0,key
Posted on 2003-11-27 10:34:49 by mrgone
Hi, mrgone. :)
Well, if your window looses keyboard focus (i.e. you click on another window, do Alt-Tab, or whatever), it won't get any more keyboard messages, while the other window will. That's just the way the GUI is supposed to work.
If you want to catch keyboard messages for other windows in your app, you'll have to forward them. If you want messages belonging to other apps, you'll have to use a global keyboard hook.


Hope that helps. ;)
Posted on 2003-11-27 16:22:55 by QvasiModo
Hey Qvasi! Actually I loose focus of keyboard inside my own window...lol. Let me check this link and see if there areany helpful hints.
Posted on 2003-11-28 12:15:35 by mrgone
Your problem could be that your calling DefWindowProc first and then using eax, so what ever is in eax is being returned. You should either return the value in eax affter DefWindowproc has been called or zero (unless a specific message requires a different return value)
Posted on 2003-11-28 12:23:18 by ENF