win32汇编 窗口问题
.386.model flat,stdcall
option casemap:none
;\\\\\\\\\\\\\\\\\\\
include windows.inc
include gdi32.inc
include user32.inc
include kernel32.inc
includelib gdi32.lib
includelib user32.lib
includelib kernel32.lib
;\\\\\\\\\\\\\\\\\\\\\\\\\
.data?
hInstance dd ?
hWinMain dd ?
.const
szClassName db 'chuangti',0
szCaption db ' 标题',0
szText db '努力学习',0
.code
_WndProc proc uses ebx edi esi,hWnd,uMsg,wParam,lParam
local @stPs:PAINTSTRUCT
local @stRect:RECT
local @hDC
mov eax,uMsg
.if eax==WM_PAINT
invoke BeginPaint,hWnd,addr @stps
mov @hDC,eax
invoke GetClientRect,hWnd,addr @stRect
invoke DrawText,@hDC,offset szText,-1,addr @stRect,DT_SINGLELINE or CENTER or VCENTER
invoke EndPaint,hWnd,addr @stPs
.elseif eax==WM_CLOSE
invoke DestroyWindow,hWinMain
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
_WndProc endp
_WinMain proc
local @stWndClass:WNDCALSSEX
local @stMsg:MSG
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
;`````
invoke LoadCursor,0,IDC_ARROW
mov @stWndClass.hCursor,eax
push hInstance
pop @stWndClass.hInstance
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW
mov @stWndClass.cbSize,sizeof WNDCALLSEX
mov @stWndClass.lpfnWndProc,_WndProc
mov @stWndClass.hbrBackground,COLOE_WINDOW+1
mov @stWndClass.lpClassName,offset szClassName
invoke RegisterClassEX,addr @stWndClass
invoke CreateWindowEX,WS_EX_CLINETEDGE,offset szClassName,offsetszCaption,WS_OVERLAPPEDWINDOW,\
100,100,600,400,NULL,NULL,hInstanse,NULL
mov hWinMain,eax
invoke ShowWindow,hWinMain,SW_SHOWNORMAL
invoke UpdateWindow,hWinMain
.while TRUE
invoke GetMessage,addr @stMsg,NULL,0,0
invoke TranslateMessage,addr @stMsg
invoke DisPatchMessage,@stMsg
.endw
ret
_WndMain endp
start:
call _WinMain
invoke ExitProcess,NULL
end start
请教一下高手
为什么 我在编译的时候 经常出现什么 什么未定义 什么的 究竟 是哪里的问题呢?
123.asm(37) : error A2006: undefined symbol : @stps
123.asm(37) : error A2114: INVOKE argument type mismatch : argument : 2
123.asm(40) : error A2006: undefined symbol : CENTER
123.asm(40) : error A2114: INVOKE argument type mismatch : argument : 5
123.asm(62) : error A2006: undefined symbol : WNDCALSSEX
123.asm(62) : error A2195: parameter or local cannot have void type
123.asm(82) : error A2006: undefined symbol : RegisterClassEX
123.asm(85) : error A2006: undefined symbol : CreateWindowEX
123.asm(99) : error A2006: undefined symbol : DisPatchMessage
123.asm(104) : fatal error A1010: unmatched block nesting : _WndMain
NMAKE : fatal error U1077: 'e:\masm32\bin\ml.EXE' : return code '0x1'
Stop.
这是哪里的问题? 新手 请高手不要见笑O(∩_∩)O