All pastes #76251 Raw Edit

gen3.asm

public text v1 · immutable
·published 2006-07-01 09:39 UTC
rendered paste body
.486
.model flat, stdcall  ;32 bit memory model
option casemap :none  ;case sensitive

include kgen3.inc

.data
szTitle		db "test1",0
szCaption	db "test2",0

.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
		mov eax,wParam
		.IF lParam==0
			.IF ax==IDC_BTN1
				shr eax,16
				.IF ax==BN_CLICKED
					invoke MessageBox, 0,addr szTitle,addr szCaption, MB_OK
				.ENDIF
			.ENDIF
		.ENDIF
 	.elseif	eax==WM_CLOSE
 		invoke	EndDialog,hWin,0
 	.else
 		mov	eax,FALSE
 		ret
 	.endif
 	mov	eax,TRUE
 	ret
DlgProc endp

end start