All pastes #747606 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-24 05:28 UTC
rendered paste body
.if edx==BN_CLICKED
	.if eax==1005
		invoke	SomeWin,hWin
	.endif
.endif

...

SomeWin proc hWin:HWND
	invoke	GetModuleHandle,NULL
	mov	hInstance,eax

	invoke	DialogBoxParam,hInstance,IDD_dialogWin,NULL,addr SomeWinMain,NULL
SomeWin endp

...

SomeWinMain proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
	mov	eax,uMsg
	.if eax==WM_INITDIALOG
		push	hWin
		pop	hWnd
	.elseif eax==WM_COMMAND
		mov	eax,wParam
		and	eax,0FFFFh
		.if eax==IDC_buttonCancel
			invoke SendMessage,hWin,WM_CLOSE,0,0
		.endif
	.elseif eax==WM_CLOSE
		invoke	EndDialog,hWin,0
	.else
		mov	eax,FALSE
		ret
	.endif
	mov		eax,TRUE
	ret
SomeWinMain endp