p; LocalDir, _
vbNullString, vbNullString, _
SW_SHOWNORMAL
打开“我的文档“
ShellExecute Me.hwnd, _
"open", "explorer", _
vbNullString, vbNullString, _
SW_SHOWNORMAL
打开“我的电脑“
'' 我的电脑
'' HKEY_CLASSES_ROOT\CLSID'' {20D04FE0-3AEA-1069-A2D8-08002B30309D}
ShellExecute Me.hwnd, "open", _
"explorer", _
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}", _
vbNullString, SW_SHOWNORMAL
打开“网上邻居“
'' 网上邻居
'' HKEY_CLASSES_ROOT\CLSID'' {208D2C60-3AEA-1069-A2D7-08002B30309D}
ShellExecute Me.hwnd, "open", _
"explorer", _
"::{208D2C60-3AEA-1069-A2D7-08002B30309D}", _
vbNullString, SW_SHOWNORMAL
打开“回收站“
'' 回收站
'' HKEY_CLASSES_ROOT\CLSID'' {645FF040-5081-101B-9F08-00AA002F954E}
ShellExecute Me.hwnd, "open", _
"explorer", _
"::{645FF040-5081-101B-9F08-00AA002F954E}", _
vbNullString, SW_SHOWNORMAL
ShellExecuteEx API演示
必要声明:
Public 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
'' Optional fields
lpIDList As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
'' fMask
Public Const SEE_MASK_CLASSKEY = &H3
Public Const SEE_MASK_CLASSNAME = &H1
Public Const SEE_MASK_CONNECTNETDRV = &H80
Public Const SEE_MASK_DOENVSUBST = &H200
Public Const SEE_MASK_FLAG_DDEWAIT = &H100
Public Const SEE_MASK_FLAG_NO_UI = &H400
Public Const SEE_MASK_HOTKEY = &H20
Public Const SEE_MASK_ICON = &H10
Public Const SEE_MASK_IDLIST = &H4
Public Const SEE_MASK_INVOKEIDLIST = &HC
Public C