.386 .model flat, stdcall ;32 bit memory model option casemap :none ;case sensitive include detettas.inc .data lpPressText db 'You Pressed the button',0 .data? hButton dd ? .code start: invoke GetModuleHandle,NULL mov hInstance,eax invoke InitCommonControls invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr DlgProc,NULL invoke ExitProcess,0 ;######################################################################## DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM mov eax,uMsg .if eax==WM_INITDIALOG .elseif eax==WM_COMMAND .if wParam==1001 Invoke GetDlgItem,hWin,1002 mov hButton,eax Invoke Invoke SetDlgItemText,hWin,1002,addr lpPressText .endif .elseif eax==WM_CLOSE invoke EndDialog,hWin,0 .else mov eax,FALSE ret .endif mov eax,TRUE ret DlgProc endp end start ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;; detettas.inc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include windows.inc include kernel32.inc include user32.inc include Comctl32.inc include shell32.inc includelib kernel32.lib includelib user32.lib includelib Comctl32.lib includelib shell32.lib DlgProc PROTO :HWND,:UINT,:WPARAM,:LPARAM .const IDD_DIALOG1 equ 101 ;######################################################################### .data? hInstance dd ? ;######################################################################### ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;; Detettas.rc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #define IDD_DIALOG1 101 #define IDC_BTN1 1001 #define IDC_EDT1 1002 #define IDC_STC1 1003 IDD_DIALOG1 DIALOGEX 6,6,219,120 CAPTION "DialogApp" FONT 8,"MS Sans Serif",0,0 STYLE 0x10CF0800 EXSTYLE 0x00000000 BEGIN CONTROL "BOOT",IDC_BTN1,"Button",0x50010000,38,79,134,30,0x00000000 CONTROL "",IDC_EDT1,"Edit",0x50010000,24,38,166,28,0x00000200 CONTROL "Written by Aniket",IDC_STC1,"Static",0x50004000,0,9,218,22,0x00000000 END