cShowFilePropertyWindow.cls
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:3k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
- END
- Attribute VB_Name = "cShowFilePropertyWindow"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = False
- Option Explicit
- 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 Const SEE_MASK_INVOKEIDLIST = &HC
- Private Const SEE_MASK_NOCLOSEPROCESS = &H40
- Private Const SEE_MASK_FLAG_NO_UI = &H400
- Private Const SW_SHOW As Long = 5
- Private Const SW_SHOWNORMAL As Long = 1
- Public Enum enumVerbType
- verbShowProperties = 0
- verbShowExplorer = 1
- End Enum
- Private Declare Function ShellExecuteEX Lib "shell32.dll" Alias _
- "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
- Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
- 'Public Sub ShowShell(FileName As String, nVerb As enumVerbType, Optional OwnerhWnd As Long = 0)
- 'Dim tVerb As String
- 'Select Case nVerb
- ' Case verbShowExplorer
- ' tVerb = "explore"
- ' Case verbShowProperties
- ' tVerb = "properties"
- 'End Select
- '
- 'ShellExecute OwnerhWnd, tVerb, FileName, vbNullString, vbNullString, SW_NORMAL
- '
- 'End Sub
- ' 使用: ShowProps("c:command.com",Me.hWnd)
- Public Sub ShowProps(FileName As String, nVerb As enumVerbType, Optional OwnerhWnd As Long = 0)
- Dim SEI As SHELLEXECUTEINFO
- Dim r As Long
- Dim tVerb As String
- Select Case nVerb
- Case verbShowExplorer
- tVerb = "explore"
- Case verbShowProperties
- tVerb = "properties"
- End Select
- With SEI
- .cbSize = Len(SEI)
- .fMask = SEE_MASK_INVOKEIDLIST Or _
- SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_FLAG_NO_UI
- .hwnd = OwnerhWnd
- .lpVerb = tVerb
- .lpFile = FileName
- .lpParameters = vbNullChar
- .lpDirectory = vbNullChar
- .nShow = SW_SHOWNORMAL
- .hInstApp = 0
- .lpIDList = 0
- End With
- r = ShellExecuteEX(SEI)
- End Sub