-
Notifications
You must be signed in to change notification settings - Fork 0
/
filedlgs.asm
52 lines (35 loc) · 1.56 KB
/
filedlgs.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; ########################################################################
GetFileName PROTO :DWORD, :DWORD, :DWORD
SaveFileName PROTO :DWORD, :DWORD, :DWORD
.data
szFileName db 260 dup(0)
ofn OPENFILENAME <> ; structure
.code
; ########################################################################
GetFileName proc hParent:DWORD,lpTitle:DWORD,lpFilter:DWORD
mov ofn.lStructSize, sizeof OPENFILENAME
m2m ofn.hWndOwner, hParent
m2m ofn.hInstance, hInstance
m2m ofn.lpstrFilter, lpFilter
m2m ofn.lpstrFile, offset szFileName
mov ofn.nMaxFile, sizeof szFileName
m2m ofn.lpstrTitle, lpTitle
mov ofn.Flags, OFN_EXPLORER or OFN_FILEMUSTEXIST or \
OFN_LONGNAMES
invoke GetOpenFileName,ADDR ofn
ret
GetFileName endp
; #########################################################################
SaveFileName proc hParent:DWORD,lpTitle:DWORD,lpFilter:DWORD
mov ofn.lStructSize, sizeof OPENFILENAME
m2m ofn.hWndOwner, hParent
m2m ofn.hInstance, hInstance
m2m ofn.lpstrFilter, lpFilter
m2m ofn.lpstrFile, offset szFileName
mov ofn.nMaxFile, sizeof szFileName
m2m ofn.lpstrTitle, lpTitle
mov ofn.Flags, OFN_EXPLORER or OFN_LONGNAMES
invoke GetSaveFileName,ADDR ofn
ret
SaveFileName endp
; ########################################################################