How to Launch the file Property Dialog
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 'File/Folder Handling - How to Launch the file Property Dialog Option Explicit 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 Public Const SEE_MASK_INVOKEIDLIST = &HC Public Const SEE_MASK_NOCLOSEPROCESS = &H40 Public Const SEE_MASK_FLAG_NO_UI = &H400 Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long Public Sub ShowProps(ByVal sFileName As String, ByVal OwnerhWnd As Long) Dim SEI As SHELLEXECUTEINFO Dim r As Long With SEI .cbSize = Len(SEI) .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI .hwnd = OwnerhWnd .lpVerb = "properties" .lpFile = sFileName .lpParameters = vbNullChar .lpDirectory = vbNullChar .nShow = 0 .hInstApp = 0 .lpIDList = 0 End With r = ShellExecuteEX(SEI) End Sub 'How to call this function 'Private Sub Form_Load() ' Call ShowProps("C:\Autoexec.bat", Me.hwnd) 'End Sub |
Related posts:
- How to Display the Properties Dialog window for the inputted file
- MP3 summary Properties
- How to show File Open dialog without using Common Dialog Control
- How to Return the file portion of a file + pathname without extension (in two ways)
- How to Return the file portion of a file + pathname (in two ways)
- How to show File Save dialog without using Common Dialog Control
- How to Return the Path portion of a file (in two ways)
- How to show File Save As Dialog using API
- How to Set the ShowInTaskBar Property at Runtime
- File Copy API with Progress Dialog