本文主要是介绍vb6纯代码调用系统的打开与保存对话框,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Private Declare Function GetOpenFileName Lib “comdlg32.dll” Alias “GetOpenFileNameA” (pOPENFILENAME As OPENFILENAME) As Long '"打开"API
Private Declare Function GetSaveFileName Lib “comdlg32.dll” Alias “GetSaveFileNameA” (pOPENFILENAME As OPENFILENAME) As Long '"保存"APIA
Private Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter 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
lCustData As Long
lpfnHook As Long
lpTemplateName As String
End Type
Private Function OpenImaget(hWnd As Long, DaBao As Boolean) As String '打开与另存为文件对话框
Dim Rtn As Long, pos As Integer
Dim file As OPENFILENAME
file.lStructSize = Len(file)
file.hwndOwner = hWnd
file.hInstance = App.hInstance
file.lpstrFile = String ( 255 , 0 ) f i l e . n M a x F i l e = 255 f i l e . l p s t r F i l e T i t l e = S t r i n g (255, 0) file.nMaxFile = 255 file.lpstrFileTitle = String (255,0)file.nMaxFile=255</
这篇关于vb6纯代码调用系统的打开与保存对话框的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!