CodeItBetter Programming Another VB Programming Blog

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:

  1. How to Display the Properties Dialog window for the inputted file
  2. MP3 summary Properties
  3. How to show File Open dialog without using Common Dialog Control
  4. How to Return the file portion of a file + pathname without extension (in two ways)
  5. How to Return the file portion of a file + pathname (in two ways)
  6. How to show File Save dialog without using Common Dialog Control
  7. How to Return the Path portion of a file (in two ways)
  8. How to show File Save As Dialog using API
  9. How to Set the ShowInTaskBar Property at Runtime
  10. File Copy API with Progress Dialog

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.