鱼C论坛

 找回密码
 立即注册
查看: 1790|回复: 1

WIN32汇编

[复制链接]
发表于 2013-4-15 21:31:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

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那里报错是为什么啊?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2013-4-16 18:46:45 | 显示全部楼层
没说出了什么问题?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-17 18:46

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表