format PE GUI 4.0
entry start
include 'C:\Program Files\Casm\win32a.inc' ; Include file win32a.inc
section '.text' code readable executable
start:
invoke GetModuleHandle,0
invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0
or eax,eax
jz exit
exit:
invoke ExitProcess,0
proc DialogProc hwnddlg,msg,wparam,lparam
push ebx esi edi
cmp [msg],WM_INITDIALOG
je .wminitdialog
cmp [msg],WM_CLOSE
je .wmclose
xor eax,eax
jmp .finish
.wminitdialog:
jmp .processed
.wmclose:
invoke EndDialog,[hwnddlg],0
.processed:
mov eax,1
.finish:
pop edi esi ebx
ret
endp
section '.bss' readable writeable
flags dd ?
caption rb 40h
message rb 100h
section '.idata' import data readable writeable
library kernel,'KERNEL32.DLL',\
user,'USER32.DLL'
import kernel,\
GetModuleHandle,'GetModuleHandleA',\
ExitProcess,'ExitProcess'
import user,\
DialogBoxParam,'DialogBoxParamA',\
EndDialog,'EndDialog'
section '.rsrc' resource data readable
directory RT_DIALOG,dialogs
resource dialogs,\
37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration
dialog demonstration,'TestProgram',170,170,105,75,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
dialogitem 'STATIC','Compile',-1,10,10,70,29,WS_VISIBLE
dialogitem 'STATIC','WITH...',-1,10,20,70,8,WS_VISIBLE
dialogitem 'STATIC','C',-1,10,30,70,8,WS_VISIBLE
dialogitem 'STATIC','A',-1,10,40,70,8,WS_VISIBLE
dialogitem 'STATIC','S',-1,10,50,70,8,WS_VISIBLE
dialogitem 'STATIC','M',-1,10,60,70,8,WS_VISIBLE
enddialog