Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
Declare Function GetSaveFileName Lib "comdlg32.dll" Alias _
"GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Boolean
Type MSA_OPENFILENAME
' 用于打开文件对话框过滤器的过滤字符串。
' 使用 MSA_CreateFilterString() 来创建它。
' 默认(Default) = 所有文件, *.*
strFilter As String
' 用于显示的初始过滤器。
' 默认(Default) = 1
lngFilterIndex As Long
' 对话框所作用的初始目录。
' 默认(Default) = 当前工作目录。
strInitialDir As String
' 初始文件名。
' 默认(Default) = ""
strInitialFile As String
strDialogTitle As String
' 默认的文件扩展名,如果用户没有指定一个的话,将使用它。
' 默认(Default) = 系统值 (打开文件, 保存文件)。
strDefaultExtension As String
' 所使用的标志 (参看“常量”(Const) 列表)
' 默认(Default) = 无标志。
lngFlags As Long
' 所选取文件的完整路径。在打开文件(OpenFile)时,如果用户点取了
' 一个不存在的文件,将只返回 "File Name"(文件名)框中的文本。
strFullPathReturned As String
' 所选取文件的文件名。
strFileNameReturned As String
' 文件名(strFileNameReturned)开始位置在完整路径中的偏移。
intFileOffset As Integer
'文件扩展名开始位置在完整路径(strFullPathReturned)中的偏移。
intFileExtension As Integer
End Type
Const ALLFILES = "所有文件"
Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As Long
nMaxCustrFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
lCustrData As Long
lpfnHook As Long
lpTemplateName As Long
End Type