VB Code:
  1. Private Type SHELLEXECUTEINFO
  2.     cbSize        As Long
  3.     fMask         As Long
  4.     hwnd          As Long
  5.     lpVerb        As String
  6.     lpFile        As String
  7.     lpParameters  As String
  8.     lpDirectory   As String
  9.     nShow         As Long
  10.     hInstApp      As Long
  11.     lpIDList      As Long     'Optional parameter
  12.     lpClass       As String   'Optional parameter
  13.     hkeyClass     As Long     'Optional parameter
  14.     dwHotKey      As Long     'Optional parameter
  15.     hIcon         As Long     'Optional parameter
  16.     hProcess      As Long     'Optional parameter
  17. End Type
  18.  
  19. Private Const SEE_MASK_INVOKEIDLIST = &HC
  20. Private Const SEE_MASK_NOCLOSEPROCESS = &H40
  21. Private Const SEE_MASK_FLAG_NO_UI = &H400
  22.  
  23. Private Declare Function ShellExecuteEx Lib "shell32.dll" (SEI As SHELLEXECUTEINFO) As Long
  24.  
  25. Private Sub ShowProperties(filename As String, OwnerhWnd As Long)
  26.  
  27.   'open a file properties property page for
  28.   'specified file if return value
  29.  
  30.    Dim SEI As SHELLEXECUTEINFO
  31.  
  32.   'Fill in the SHELLEXECUTEINFO structure
  33.    With SEI
  34.       .cbSize = Len(SEI)
  35.       .fMask = SEE_MASK_NOCLOSEPROCESS Or _
  36.                SEE_MASK_INVOKEIDLIST Or _
  37.                SEE_MASK_FLAG_NO_UI
  38.       .hwnd = OwnerhWnd
  39.       .lpVerb = "properties"
  40.       .lpFile = filename
  41.       .lpParameters = vbNullChar
  42.       .lpDirectory = vbNullChar
  43.       .nShow = 0
  44.       .hInstApp = 0
  45.       .lpIDList = 0
  46.    End With
  47.  
  48.   'call the API to display the property sheet
  49.    Call ShellExecuteEx(SEI)
  50.  
  51. End Sub
  52.  
  53. 'Usage:   Place the full path and file name in the text box
  54. Private Sub Command1_Click()
  55. Call ShowProperties((Text1.Text), Me.hwnd)
  56. End Sub