I write a program in which I create 2 edit boxes, 2 lists and 2 buttons inside the window - see text below. Program works but when I press tab button to pass from one window to another operation fails. Why?
Thanks, Mike

PS. See attach file for source
Posted on 2002-01-02 09:03:59 by Mike
If you want the "dialog box" navigate functions you must call IsDialogMessage in your message loop (yes, even if your window isn't a dialog box)

japheth
Posted on 2002-01-02 09:23:13 by japheth
And here is an example of a message loop.

Message loop


.while TRUE
invoke GetMessage,addr msg,NULL,0,0
.BREAK .if !eax
invoke IsDialogMessage,hWnd,addr msg
.if !eax
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
.endif
.endw



KetilO
Posted on 2002-01-02 09:30:01 by KetilO
and don't forget to set the WS_TABSTOP windows-style...

oh and you don't have to call translatemsg & dispatchmsg...
isdialogmessage translates and dispatches keyboard msg's
alone, too...



_Start: invoke GetMessage,ADDR msg,NULL,0,0
test eax, eax
jz _Exit
invoke IsDialogMessage,hWnd,addr msg
jmp _Start
_Exit: mov eax,msg.wParam
ret

...and later...

invoke CreateWindowEx, NULL, ADDR ButtonClassName,ADDR Button1Text,\
WS_CHILD or WS_VISIBLE or WS_TABSTOP or BS_DEFPUSHBUTTON,\
430,30,100,25,hWin,Button1ID,hInstance,NULL

...
Posted on 2002-01-02 09:59:28 by mob