WIN32汇编,不知道哪里出了问题了
自己动手写个简单的对话框,RC和ASM都是自己写的,主要是根据书中的例子,自己看过之后,尝试动手加深记忆!
但是生成的exe文件:1.无法关闭 2.显示出来的对话框奇形怪状。
自己看了半天了,改了好几处地方,也不知道怎么回事!索性恢复到原来的样子,期盼大家给我点指导!
RC
#include<resource.h>
#defineICO_MAIN0x0001
#defineDLG_MAIN1
#defineIDB_12
#defineIDB_23
#defineIDC_PIC100
#defineIDC_PERINFO101
#defineIDC_PERNAME102
#defineIDC_PERSEXL103
#defineIDC_PERADDR104
#defineIDC_PERCOMINFO201
#defineIDC_OWN202
#defineIDC_NOTOWN203
#defineIDC_CHANBIT301
#defineIDC_CANCEL300
ICO_MAINICON"Main.ico"
IDB_1BITMAP"1.bmp"
IDB_2BITMAP"2.bmp"
DLG_MAINDIALOG55,55,400,300
STYLEDS_MODALFRAME|WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME
CAPTION"个人信息"
FONT9,"宋体"
{
GROUPBOX"照片",-1,5,20,100,60
GROUPBOX"个人资料",IDC_PERINFO,125,20,200,60
//LTEXT"姓名:",-1,135,22,15,20
//EDITTEXTIDC_PERNAME,155,22,100,20
//LTEXT"性别:",-1,135,45,15,20
//EDITTEXTIDC_PERSEXL,155,45,100,20
//LTEXT"住址:",-1,135,68,15,20
//EDITTEXTIDC_PERADDR,155,68,100,20
//LTEXT"是否有万达的VIP卡",-1,135,95,100,20,WS_BORDER
AUTORADIOBUTTON"是",IDC_OWN,215,100,15,15,
AUTORADIOBUTTON"否",IDC_NOTOWN,225,100,15,15
}
.386
.model flat,stdcall
option casemap:none
includewindows.inc
includeuser32.inc
includelibuser32.lib
includekernel32.inc
includelibkernel32.lib
includegdi32.inc
includelibgdi32.lib
ICO_MAINequ0001h
DLG_MAINequ1
IDB_1equ2
IDB_2equ3
IDC_PICequ100
IDC_PERINFOequ101
IDC_PERNAMEequ102
IDC_PERSEXLequ103
IDC_PERADDRequ104
IDC_PERCOMINFOequ201
IDC_OWNequ202
IDC_NOTOWNequ203
IDC_CHANBITequ301
IDC_CANCELequ300
.data?
hInstancedd?
.code
_DlgProcMainprocuses ebx esi edi hWnd,uMsg,wParam,lParam
moveax,uMsg
.if eax==WM_CLOSE
invoke EndDialog,hWnd,NULL
.elseif eax==WM_INITDIALOG
invoke LoadIcon,hInstance,ICO_MAIN
invoke SendMessage,hWnd,WM_SETICON,ICON_BIG,eax
.else
mov eax,TRUE
.endif
ret
_DlgProcMainendp
start:
invoke GetModuleHandle,NULL
movhInstance,eax
invoke DialogBoxParam,hInstance,DLG_MAIN,NULL,offset _DlgProcMain,NULL
invoke ExitProcess,NULL
end start