Here is a simple dialog box example :
include ColorDlg.inc
IDM_ABOUT equ 11
IDM_EXIT equ 12
IDC_ABOUT equ 110
IDC_EXIT equ 120
IDC_EDIT equ 3000
.data
Resource db 'MYDIALOG',0
msg db 'Dialog box example',0
title1 db 'About',0
.data?
hBrush dd ?
.code
start:
invoke GetModuleHandle,NULL
invoke DialogBoxParam,eax,ADDR Resource,NULL,ADDR DlgProc,NULL
invoke ExitProcess,eax
DlgProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
.IF uMsg==WM_CTLCOLORDLG
invoke CreateSolidBrush,Blue
mov hBrush,eax
ret
.ELSEIF uMsg==WM_CLOSE
invoke SendMessage,hWnd,WM_COMMAND,IDM_EXIT,0
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF lParam==0
.IF ax==IDM_ABOUT
invoke MessageBox,NULL,ADDR msg,ADDR title1,MB_OK
.ELSEIF ax==IDM_EXIT
@@:
invoke DeleteObject,hBrush
invoke EndDialog, hWnd,NULL
.ENDIF
.ELSE
mov edx,wParam
shr edx,16
.IF dx==BN_CLICKED
.IF ax==IDC_ABOUT
invoke SendMessage,hWnd,WM_COMMAND,IDM_ABOUT,0
.ELSEIF ax==IDC_EXIT
jmp @b
.ENDIF
.ENDIF
.ENDIF
.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
DlgProc ENDP
END start