Hi all
If i create two buttons by CreatewindowEx, why ths tab key can't work even i add WS_TABSTOP style ??
my code is below


.586p ; minimum processor needed for 32 bit
.model flat, stdcall ; FLAT memory model & STDCALL calling
option casemap :none ; set code to case sensitive

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD

.data

hInstance dd ?
MainClassName db "Main Class",0
ButtonClassName db 'BUTTON',0
AppName db 'TEST',0
szMenuName db "Menu",0
szButtonText db "Button",0

.code

start:
invoke GetModuleHandle, NULL
mov hInstance,eax

invoke WinMain, hInstance, NULL, NULL, SW_SHOWDEFAULT

invoke ExitProcess, eax

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,NULL
mov wc.cbWndExtra,NULL
push hInst
pop wc.hInstance
mov wc.hbrBackground, COLOR_BTNSHADOW

mov wc.lpszMenuName, OFFSET szMenuName
mov wc.lpszClassName,OFFSET MainClassName
invoke LoadIcon,NULL,IDI_APPLICATION
mov wc.hIcon,eax
mov wc.hIconSm,eax
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor,eax
invoke RegisterClassEx, addr wc

invoke CreateWindowEx, NULL,
ADDR MainClassName,
ADDR AppName,
WS_OVERLAPPEDWINDOW or WS_TABSTOP,
20,
20,
530,
530,
NULL,
NULL,
hInst,
NULL

mov hwnd,eax
invoke ShowWindow, hwnd, SW_SHOWNORMAL
invoke UpdateWindow, hwnd

.while TRUE
invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.endw
mov eax,msg.wParam
ret

WinMain endp

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

.if uMsg==WM_CREATE

invoke CreateWindowEx, WS_EX_CONTROLPARENT, ADDR ButtonClassName,
ADDR szButtonText,
WS_CHILD or WS_VISIBLE or BS_PUSHBUTTON or WS_TABSTOP,
70,150,80,30, hWnd, 1000, hInstance, NULL
invoke CreateWindowEx, WS_EX_CONTROLPARENT, ADDR ButtonClassName,
ADDR szButtonText,
WS_CHILD or WS_VISIBLE or WS_TABSTOP,
270,150,80,30, hWnd, 2000, hInstance, NULL

.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,NULL

.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret

.endif
xor eax, eax
ret
WndProc endp
end start
Posted on 2003-09-07 21:01:58 by jordanc
First as a tip, if your posting a lengthy bit of code, its better for others to read if you place it in code blocks, by adding [ code ] before your paste, and [ /code ] after your code is pasted. (Note: actual code blocks are to have no spaces between the brackets).

Second, you might want to try out the search engine. I talked about this topic a few weeks back.

Are you feeling lucky? -->

Regards,
:NaN:
Posted on 2003-09-07 21:26:43 by NaN
Dear Nan
thank for your correct and help
the problem already solved
Posted on 2003-09-08 00:54:27 by jordanc