Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Nov 18, 2000

ShowFileProperties - Display the Property Page of a file

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 Declare Function ShellExecuteEX Lib "shell32.dll" Alias _
    "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long

Const SEE_MASK_INVOKEIDLIST = &HC
Const SEE_MASK_NOCLOSEPROCESS = &H40
Const SEE_MASK_FLAG_NO_UI = &H400

' Display the property page associated to a file

Sub ShowFileProperties(sFile As String)
    Dim SEI As SHELLEXECUTEINFO
    ' Fill the SHELLEXECUTEINFO structure
    With SEI
        .cbSize = Len(SEI)
        .fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or _
            SEE_MASK_FLAG_NO_UI
        .lpVerb = "properties"
        .lpFile = sFile
    End With
    ' execute
    ShellExecuteEX SEI
End Sub

Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date