WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolder(
LPBROWSEINFO lpbi
);
LPBROWSEINFO lpbi
);
解决方案 »
- 求高手指点小弟,怎样点击WebBrowser中这样的文字链接!
- 帮我看一下:为何查询日期最大值后有返回记录,取值时出错!
- 有关菜单的问题,许久没有解决,在线求助!
- VSFlexGrid导出EXCEL问题
- crystal report的问题
- 关于MSHFlexGrid的数据保存问题
- 急:DTPicker日期控件是如何将日期转化为整数来存放的?(几周了都没有找出规律)
- unsupported feature with RETURNING clause
- 如何出掉窗体的边框和标题。(不用mdi窗体实现!)
- uguess(uguess)如果你把你的联系方式告诉我的话我再给你58分,如果不好说的话就mailto [email protected]
- 请问各位大哥,如何使窗体的标题栏闪动(前5人一定发粉)
- 请问oledb数据库需要安装吗?(win2k&vb6.0)
谢谢你
可是我看不明白到底那个是
你指的函数呢
LPBROWSEINFO lpbi
);
' (To add the Common Dialog Box to your tools menu, go to Project->Components (or press CTRL-T)
' and select Microsoft Common Dialog control)
Private Type SHFILEOPSTRUCT
hWnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Const FO_DELETE = &H3
Private Const FOF_ALLOWUNDO = &H40
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim SHFileOp As SHFILEOPSTRUCT
'Set the dialog's title
CDBox.DialogTitle = "Select a file to delete ..."
'Set the dialog's filter
CDBox.Filter = "All Files (*.*)|*.*"
'Show the 'Open File' dialog
CDBox.ShowOpen
With SHFileOp
'Delete the file
.wFunc = FO_DELETE
'Select the file
.pFrom = CDBox.filename
'Allow 'move to recycle bn'
.fFlags = FOF_ALLOWUNDO
End With
'perform file operation
SHFileOperation SHFileOp
MsgBox "The file '" + CDBox.filename + "' has been moved to your Recycling Bin !", vbInformation + vbOKOnly, App.Title
End Sub
CommonDialog 控件
CommonDialog 控件提供一组标准的操作对话框,进行诸如打开和保存文件,设置打印选项,以及选择颜色和字体等操作。通过运行 Windows 帮助引擎控件还能显示帮助。语法CommonDialog说明CommonDialog 控件在 Visual Basic 和 Microsoft Windows 动态链接库 ommdlg.dll. 的例程之间提供了一个接口。为了用这个控件创建一个对话框,ommdlg.dll. 必须在 Microsoft Windows 的 SYSTEM 目录下。在应用程序中要使用 CommonDialog 控件,可将其添加到窗体中并设置其属性。控件所显示的对话框由控件的方法确定。在运行时,当相应的方法被调用时,将显示一个对话框或是执行帮助引擎;在设计时,CommonDialog 控件是以图标的形式显示在窗体中。该图标的大小不能改变。使用指定的方法,CommonDialog 控件能够显示下列对话。方法 所显示的对话框
ShowOpen 显示“打开”对话框
ShowSave 显示“另存为”对话框
ShowColor 显示“颜色”对话框
ShowFont 显示“字体”对话框
ShowPrinter 显示“打印”或“打印选项”对话框
ShowHelp 调用 Windows 帮助引擎
在对话框接口上单击,CommonDialog 控件将自动提供与上下文有关的帮助: 单击标题栏中的“这是什么?”帮助按钮,然后单击想详细信息的项目。
将鼠标放在想进一步详细信息的项目上,单击右键,然后在所显示的上下文菜单中选择这是什么命令。
操作系统提供在 Windows 95 帮助弹出中显示的文本。也可以通过设置 Flags 属性,在带有 CommonDialog 控件的对话框中显示一个帮助按钮,但是,必须在这个位置提供帮助主题。注意 无法指定对话框显示在什么地方。详细信息 要查看各对话的帮助主题,单击“请参阅”。
下例显示“打开”对话框然后在信息框中显示所选的文件名:Private Sub Command1_Click()
' 设置“CancelError”为 True
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' 设置标志
CommonDialog1.Flags = cdlOFNHideReadOnly
' 设置过滤器
CommonDialog1.Filter = "All Files (*.*)|*.*|Text Files" & _
"(*.txt)|*.txt|Batch Files (*.bat)|*.bat"
' 指定缺省的过滤器
CommonDialog1.FilterIndex = 2
' 显示“打开”对话框
CommonDialog1.ShowOpen
' 显示选定文件的名字
MsgBox CommonDialog1.filename
Exit SubErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub
佩服!