WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolder(
    LPBROWSEINFO lpbi
); 

解决方案 »

  1.   

    niqiu,你好
    谢谢你
    可是我看不明白到底那个是
    你指的函数呢 
      

  2.   

    SHBrowseForFolder(
    LPBROWSEINFO lpbi
    ); 
      

  3.   

    'This program needs a Common Dialog Box, named CDBox.
    '  (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
      

  4.   


     
    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 控件的对话框中显示一个帮助按钮,但是,必须在这个位置提供帮助主题。注意 无法指定对话框显示在什么地方。详细信息 要查看各对话的帮助主题,单击“请参阅”。
      

  5.   

    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
      

  6.   

    dbcontrols(泰山__抛砖引玉)
    佩服!