;made by correy
;made in 2009.04.01
;Email:leguanyuan@126.com
;QQ:112426112
;made in 2009.04.01
;Email:leguanyuan@126.com
;QQ:112426112
;rc me.rc
;ml /coff test.asm /link /subsystem:windows me.res
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
.const
me equ 07777h
IDM_open equ 9
IDM_save equ 99
IDM_exit equ 999
IDM_about equ 9999
.data?
hInstance dd ?
hMenu dd ?
stWndClass WNDCLASSEX <>
stMsg MSG <>
.data
szClassName db "correy",0
menocorrey db "meno_correy",0
.code
liuchunli proc hWnd,uMsg,wParam,lParam
mov eax,uMsg
.if eax == WM_CREATE
invoke LoadIcon,hInstance,me
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
ret
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF ax==9
invoke MessageBox,NULL,ADDR szClassName,OFFSET szClassName,MB_OK
.ELSEIF ax==99
invoke MessageBox, NULL,ADDR szClassName, OFFSET szClassName,MB_OK
.ELSEIF ax==999
invoke DestroyWindow,hWnd
.ELSE
invoke MessageBox,NULL,ADDR szClassName, OFFSET szClassName, MB_OK
.ENDIF
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
ret
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
liuchunli endp
start:invoke GetModuleHandle,NULL
mov hInstance,eax
invoke LoadMenu, 0, OFFSET menocorrey
mov hMenu,eax
push hInstance
pop stWndClass.hInstance
mov stWndClass.cbSize,sizeof WNDCLASSEX
mov stWndClass.hbrBackground,6
invoke LoadCursor,0,IDC_ARROW
mov stWndClass.hCursor,eax
;mov stWndClass.lpszMenuName,OFFSET menocorrey
mov stWndClass.lpszClassName,offset szClassName
mov stWndClass.lpfnWndProc,offset liuchunli
invoke RegisterClassEx,addr stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,offset szClassName,offset szClassName,\
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,hMenu,hInstance,0
mov hInstance,eax
invoke ShowWindow,hInstance,1
invoke UpdateWindow,hInstance
.while TRUE
invoke GetMessage,addr stMsg,NULL,0,0
.break .if eax == 0
invoke TranslateMessage,addr stMsg
invoke DispatchMessage,addr stMsg
.endw
invoke ExitProcess,NULL
end start
;ml /coff test.asm /link /subsystem:windows me.res
.386
.model flat,stdcall
option casemap:none
include windows.inc
include kernel32.inc
include user32.inc
includelib user32.lib
includelib kernel32.lib
.const
me equ 07777h
IDM_open equ 9
IDM_save equ 99
IDM_exit equ 999
IDM_about equ 9999
.data?
hInstance dd ?
hMenu dd ?
stWndClass WNDCLASSEX <>
stMsg MSG <>
.data
szClassName db "correy",0
menocorrey db "meno_correy",0
.code
liuchunli proc hWnd,uMsg,wParam,lParam
mov eax,uMsg
.if eax == WM_CREATE
invoke LoadIcon,hInstance,me
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
ret
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF ax==9
invoke MessageBox,NULL,ADDR szClassName,OFFSET szClassName,MB_OK
.ELSEIF ax==99
invoke MessageBox, NULL,ADDR szClassName, OFFSET szClassName,MB_OK
.ELSEIF ax==999
invoke DestroyWindow,hWnd
.ELSE
invoke MessageBox,NULL,ADDR szClassName, OFFSET szClassName, MB_OK
.ENDIF
.elseif uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
ret
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
liuchunli endp
start:invoke GetModuleHandle,NULL
mov hInstance,eax
invoke LoadMenu, 0, OFFSET menocorrey
mov hMenu,eax
push hInstance
pop stWndClass.hInstance
mov stWndClass.cbSize,sizeof WNDCLASSEX
mov stWndClass.hbrBackground,6
invoke LoadCursor,0,IDC_ARROW
mov stWndClass.hCursor,eax
;mov stWndClass.lpszMenuName,OFFSET menocorrey
mov stWndClass.lpszClassName,offset szClassName
mov stWndClass.lpfnWndProc,offset liuchunli
invoke RegisterClassEx,addr stWndClass
invoke CreateWindowEx,WS_EX_CLIENTEDGE,offset szClassName,offset szClassName,\
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,hMenu,hInstance,0
mov hInstance,eax
invoke ShowWindow,hInstance,1
invoke UpdateWindow,hInstance
.while TRUE
invoke GetMessage,addr stMsg,NULL,0,0
.break .if eax == 0
invoke TranslateMessage,addr stMsg
invoke DispatchMessage,addr stMsg
.endw
invoke ExitProcess,NULL
end start
rc文件如下:
#include
#define ICO_BIG 0x1000
#define me 0x7777
#define IDM_open 9
#define IDM_save 99
#define IDM_exit 999
#define IDM_about 9999
me ICON "me.ico"
meno_correy menu discardable
BEGIN
popup "文件(&F)"
BEGIN
menuitem "打开(&o)",IDM_open
menuitem "保存(&s)",IDM_save
menuitem "退出(&X)",IDM_exit
END
popup "帮助(&h)"
BEGIN
menuitem "关于",IDM_about
END
END
1 VERSIONINFO
FILEVERSION 9,9,9,9
PRODUCTVERSION 9,9,9,9
FILEOS 0
FILETYPE 0
FILESUBTYPE 0
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "Comments", "Email:leguanyuan@126.com;QQ:112426112."
VALUE "CompanyName", "correy "
VALUE "FileVersion", "made by correy "
VALUE "FileDescription", "made by correy"
VALUE "InternalName", "made by correy"
VALUE "LegalCopyright", "made by correy"
VALUE "LegalTrademarks", "made by correy"
VALUE "OriginalFilename", "made by correy"
VALUE "ProductName", "made by correy"
VALUE "ProductVersion", "made by correy"
VALUE "PrivateBuild", "made by correy"
VALUE "SpecialBuild", "made by correy"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 2052, 1200
}
}
#include
#define ICO_BIG 0x1000
#define me 0x7777
#define IDM_open 9
#define IDM_save 99
#define IDM_exit 999
#define IDM_about 9999
me ICON "me.ico"
meno_correy menu discardable
BEGIN
popup "文件(&F)"
BEGIN
menuitem "打开(&o)",IDM_open
menuitem "保存(&s)",IDM_save
menuitem "退出(&X)",IDM_exit
END
popup "帮助(&h)"
BEGIN
menuitem "关于",IDM_about
END
END
1 VERSIONINFO
FILEVERSION 9,9,9,9
PRODUCTVERSION 9,9,9,9
FILEOS 0
FILETYPE 0
FILESUBTYPE 0
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "Comments", "Email:leguanyuan@126.com;QQ:112426112."
VALUE "CompanyName", "correy "
VALUE "FileVersion", "made by correy "
VALUE "FileDescription", "made by correy"
VALUE "InternalName", "made by correy"
VALUE "LegalCopyright", "made by correy"
VALUE "LegalTrademarks", "made by correy"
VALUE "OriginalFilename", "made by correy"
VALUE "ProductName", "made by correy"
VALUE "ProductVersion", "made by correy"
VALUE "PrivateBuild", "made by correy"
VALUE "SpecialBuild", "made by correy"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 2052, 1200
}
}
没有评论:
发表评论