|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
.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
ClassName db 'myclass',0
windowname db '回信程序',0
hinstance dword ?
hwnd dword ?
buffer byte 123 dup (?)
.code
win_proc proc uses esi edi ebx hWnd,uMsg,wParam,lParam
mov eax,uMsg
.if eax==WM_SETTEXT
INVOKE wsprintf,offset buffer,lParam
invoke MessageBox,NULL,NULL,offset buffer,MB_OK
.elseif eax==WM_CLOSE
invoke DestroyWindow,hWnd
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
ret
win_proc endp
win_main proc
local @stWndClass:WNDCLASSEX
local @stMSG:MSG
invoke GetModuleHandle,NULL
mov hinstance,eax
invoke RtlZeroMemory,addr @stWndClass,sizeof WNDCLASSEX
push hinstance
pop @stWndClass.hinstance
mov @stWndClass.cbSize,sizeof @stWndClass
mov @stWndClass.style,CS_HREDRAW or CS_VREDRAW or WM_LBUTTONDBLCLK
mov @stWndClass.lpfnWndProc,offset win_proc
mov @stWndClass.hbrBackground,COLOR_WINDOW +1
mov @stWndClass.lpszClassName,offset ClassName
invoke RegisterClassEx,addr @stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,offset ClassName,offset windowname,WS_OVERLAPPEDWINDOW or WS_SYSMENU,\
20,40,400,200,NULL,NULL,addr hinstance,NULL
mov hwnd,eax
invoke ShowWindow,hwnd,SW_SHOWNORMAL
invoke UpdateWindow,hwnd
.while TRUE
invoke GetMessage,addr @stMSG,NULL,0,0
.break .if eax==0
invoke TranslateMessage,addr @stMSG
invoke DispatchMessage,addr @stMSG
.endw
ret
win_main endp
start:
call win_main
invoke ExitProcess,NULL
end start
在POP @stWndClass.hinstane那里报错是为什么啊?
|
|