I'm guessing you are asking for something like the following?
Sorry i didn't include credits, it didn't come with any and i forgot where i downloaded it from.
; Template using RES file
include 'win32ax.inc'
IDD_MAINDLG = 101 ; Control IDs
IDC_EXIT = 40001 ; Retrieved from the .h file automatically made from VC++
.data
hInstance dd ? ; Our instance handle
.code
start:
invoke GetModuleHandle, 0
mov [hInstance], eax
invoke DialogBoxParam, [hInstance], IDD_MAINDLG, 0, dlgProc, 0
invoke ExitProcess, 0
.end start
proc dlgProc, hDlg, uMsg, wParam, lParam
push ebx esi edi
cmp [uMsg], WM_COMMAND
je .wmcommand
cmp [uMsg], WM_CLOSE
je .wmclose
cmp [uMsg], WM_INITDIALOG
je .wminitdlg
cmp [uMsg], WM_DESTROY
je .wmclose
cmp [uMsg], WM_COMMAND
je .wmcommand
xor eax, eax
jmp .finish
.wminitdlg:
mov eax, 1
jmp .finish
.wmclose:
invoke EndDialog, [hDlg], 0
mov eax, 1
jmp .finish
.wmcommand:
mov eax, [wParam]
and eax, 0x0FFFF ; To get the LOWORD of wParam
cmp eax, IDC_EXIT
je .wmclose
mov eax, 0
jmp .finish ; Just here incase I add another message below, such as WM_TIMER
.finish:
pop edi esi ebx
ret
endp
section '.rsrc' data readable resource from 'resource.res' ; Import external .res file (created by a different program, such as VC++)
Or were you referring to something like...
Reading the resource data into a buffer and writing the buffer to a file?