如何打开文件属性对话框?

解决方案 »

  1.   

    Private Type SHELLEXECUTEINFO
    cbSize As Long
    fMask As Long
    hWnd As Long
    lpVerb As String
    lpFile As String
    lpParameters As String
    lpDirectory As String
    nShow As Long
    hInstApp As Long
    lpIDList As Long
    lpClass As String
    hkeyClass As Long
    dwHotKey As Long
    hIcon As Long
    hProcess As Long
    End Type
    Private Declare Function ShellExecuteEx Lib "shell32" (lpxx As SHELLEXECUTEINFO) As Long
    Private Const SEE_MASK_INVOKEIDLIST = &HC
    Private Sub Form_Click()
    Call ShowFileProperties( _
    "c:\windows\system32\shell32.dll")
    End Sub
    Private Sub ShowFileProperties(ByVal aFile As _
    String)
    Dim xx As SHELLEXECUTEINFO
    xx.hWnd = Me.hWnd
    xx.lpVerb = "properties"
    xx.lpFile = aFile
    xx.fMask = SEE_MASK_INVOKEIDLIST
    xx.cbSize = Len(xx)
    ShellExecuteEx xx
    End Sub