pop ofn.hwndowner
push hinstance
pop ofn.hinstance
mov ofn.lpstrfilter, offset filterstring
mov ofn.lpstrfile, offset buffer
mov ofn.nmaxfile,maxsize
mov ofn.flags, ofn_filemustexist or \
ofn_pathmustexist or ofn_longnames or\
ofn_explorer or ofn_hidereadonly
mov ofn.lpstrtitle, offset ourtitle
invoke getopenfilename, addr ofn
.if eax==true
invoke lstrcat,offset outputstring,offset fullpathname
invoke lstrcat,offset outputstring,ofn.lpstrfile
invoke lstrcat,offset outputstring,offset crlf
invoke lstrcat,offset outputstring,offset fullname
mov eax,ofn.lpstrfile
push ebx
xor ebx,ebx
mov bx,ofn.nfileoffset
add eax,ebx
pop ebx
invoke lstrcat,offset outputstring,eax
invoke lstrcat,offset outputstring,offset crlf
invoke lstrcat,offset outputstring,offset extensionname
mov eax,ofn.lpstrfile
push ebx
xor ebx,ebx
mov bx,ofn.nfileextension
add eax,ebx
pop ebx
invoke lstrcat,offset outputstring,eax
invoke messagebox,hwnd,offset outputstring,addr appname,mb_ok
invoke rtlzeromemory,offset outputstring,outputsize
.endif
.else
invoke destroywindow, hwnd
.endif
.else
invoke defwindowproc,hwnd,umsg,wparam,lparam
ret
.endif
xor eax,eax
ret
wndproc endp