invoke GetModuleHandle, NULL
mov hInstance, eax
...(set wc)
invoke RegisterClassEx, ADDR wc
invoke CreateWindowEx,WS_EX_LEFT,
ADDR szClassName,
ADDR szDisplayName,
WS_OVERLAPPEDWINDOW,
Wtx,Wty,Wwd,Wht,
NULL,NULL,
hInst,NULL
mov hWnd,eax
szClassName, szDisplayName,Wtx, Wty, Wwd, Wht have all been set
complied but no window was created~~~
When debugging, I find that after CreateWindowEx, hWnd(eax) = 000000...
need help~~~
Is hInst initialised? I noticed hInstance is but no hInst
What does RegisterClassEx return?
If you are using windbg try !gle
sorry because I cut code from two proc together...
hInst = hInstance in fact.
and I tried useinvoke GetLastError
but eax = 000000
Make sure your WM_CREATE handler returns 0
Not enough of your code to know.
edit: try using WS_VISIBLE
invoke RegisterClassEx, ADDR wc
eax = 0000C1B4(or else~~~not 000000)-->registered
I am new to masm32 and not familiar with win32 api...
invoke GetModuleHandle, NULL
mov hInst, eax
invoke LoadIcon,hInst,500
mov hIcon, eax
mov wc.cbSize, sizeof WNDCLASSEX
mov wc.style, CS_BYTEALIGNWINDOW
mov wc.lpfnWndProc, offset WndProc
mov wc.cbClsExtra, NULL
mov wc.cbWndExtra, NULL
m2m wc.hInstance, hInst
mov wc.hbrBackground, COLOR_BTNFACE+1
mov wc.lpszMenuName, NULL
mov wc.lpszClassName, offset szClassName
m2m wc.hIcon, hIcon
invoke LoadCursor,NULL,IDC_ARROW
mov wc.hCursor, eax
m2m wc.hIconSm, hIcon
invoke RegisterClassEx, ADDR wc
;window size
mov Wwd, 600
mov Wht, 700
;window top-left
mov Wtx, 100
mov Wty, 100
invoke CreateWindowEx,WS_EX_LEFT, ADDR szClassName, ADDR szDisplayName,WS_OVERLAPPEDWINDOW,Wtx,Wty,Wwd,Wht,NULL,NULL,hInst,NULL
mov hWnd,eax
:bg :bg :bg
Again I find the problem myself...
I lost some code in WndProc proc~~~
thanks a lot~sinsi :bdg :bdg :bdg