Taborder don't work. This must be a simple problem. I can't find out why it doesn't work.

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:HWND

mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style,CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc,OFFSET WndProc
mov wc.cbClsExtra,0
mov wc.cbWndExtra,0
; mov wc.cbWndExtra,DLGWINDOWEXTRA
; mov wc.cbWndExtra,32
; mov wc.cbWndExtra,36
push hInstance
pop wc.hInstance
mov wc.hbrBackground,COLOR_BTNFACE+1
mov wc.lpszMenuName,0
mov wc.lpszClassName,OFFSET ClassName

invoke LoadIcon,0,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax

invoke LoadCursor,0,IDC_ARROW
mov wc.hCursor,eax

invoke RegisterClassEx,addr wc
invoke CreateWindowEx,0,addr ClassName,addr AppName,WS_OVERLAPPEDWINDOW,\
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,hInst,0
mov  hwnd,eax

invoke ShowWindow,hwnd,CmdShow
invoke UpdateWindow,hwnd

@@:
invoke GetMessage,addr msg,0,0,0
.if eax==0
jmp @F
.endif
invoke IsDialogMessage,hwnd, ADDR msg
  .if eax==0
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
.endif
jmp @B
@@:
mov eax,msg.wParam
ret
WinMain endp

WndProc proc hwnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.if uMsg==WM_DESTROY
invoke PostQuitMessage,0

.elseif uMsg==WM_CREATE
        invoke CreateWindowEx,WS_EX_CLIENTEDGE,addr szEdit, 0, \
            WS_VISIBLE Or WS_CHILD Or WS_VSCROLL Or ES_MULTILINE Or WS_TABSTOP, \
            10,10,470,100,hwnd,1000,hInstance, 0
mov hEdt1,eax

        invoke CreateWindowEx,0,addr szButton,addr szButton,\
            WS_CHILD Or WS_VISIBLE Or WS_TABSTOP,\
            10,120,110,30,hwnd,1001,hInstance,0
        mov hBtn1,eax
       
        invoke CreateWindowEx,0,addr szButton,addr szButton, \
            WS_CHILD Or WS_VISIBLE Or WS_TABSTOP, \
            120,120,140,30,hwnd,1002,hInstance,0
        mov hBtn2,eax
       
        invoke CreateWindowEx,0,addr szButton,addr szButton, \
            WS_CHILD Or WS_VISIBLE Or WS_TABSTOP, \
            260,120,110,30,hwnd,1003,hInstance,0
        mov hBtn3,eax
       
        invoke CreateWindowEx,0,addr szButton,addr szButton, \
            WS_CHILD Or WS_VISIBLE Or WS_TABSTOP, \
            370,120,110,30,hwnd,1004,hInstance,0
        mov hBtn4,eax
       
        invoke GetStockObject,DEFAULT_GUI_FONT
        mov hFont,eax
        invoke SendMessage,hEdt1,WM_SETFONT,hFont,TRUE
        invoke SendMessage,hBtn1,WM_SETFONT,hFont,TRUE
        invoke SendMessage,hBtn2,WM_SETFONT,hFont,TRUE
        invoke SendMessage,hBtn3,WM_SETFONT,hFont,TRUE
        invoke SendMessage,hBtn4,WM_SETFONT,hFont,TRUE
       
.else
invoke DefWindowProc,hwnd,uMsg,wParam,lParam
ret
.endif

xor eax,eax
ret
WndProc endp


I should say that if no window is on focus first tab focus edit window, next tab don't work. If a button is on focus first tab focus next button and so on till edit window focus but stops there.
Posted on 2006-10-07 07:54:12 by minor28
Find the problem.

Because the dialog box keyboard interface uses direction keys to move between controls in a dialog box, an application cannot use these keys to scroll the contents of any modal dialog box or any modeless dialog box for which IsDialogMessage is called. When a dialog box has scroll bars, the application must provide an alternate keyboard interface for the scroll bars. Note that the mouse interface for scrolling is available when the system includes a mouse.


Now I must find a way to provide an alternate keyboard interface for the scroll bars.
Posted on 2006-10-08 08:18:41 by minor28