Displaying the File Properties Dialog | CodeGuru

Displaying the File Properties Dialog

Author: Lothar A. Haensler Displaying the File Properties Dialog This code shows how to display the file properties dialog through VB5/6 Code. Paste the following code into a module in your project: option Explicit ‘ private Const SW_SHOW = 5 private Const SEE_MASK_INVOKEIDLIST = &HC private Type SHELLEXECUTEINFO cbSize as Long fMask as Long hwnd […]

Written By
CodeGuru Staff
CodeGuru Staff
Jan 27, 2004
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Author: Lothar A. Haensler

Displaying the File Properties Dialog

This code shows how to display the file properties dialog through VB5/6 Code.

screen shot

Paste the following code into a module in your project:

option Explicit
'
private Const SW_SHOW = 5
private Const SEE_MASK_INVOKEIDLIST = &HC
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
    ' optional fields
    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" _
    (byref s as SHELLEXECUTEINFO) as Long

public Sub DisplayFileProperties(byval sFullFileAndPathName as string)
    Dim shInfo as SHELLEXECUTEINFO

    With shInfo
        .cbSize = LenB(shInfo)
        .lpFile = sFullFileAndPathName
        .nShow = SW_SHOW
        .fMask = SEE_MASK_INVOKEIDLIST
        .lpVerb = "properties"
    End With

    ShellExecuteEx shInfo
End Sub

Now simply call the DisplayFileProperties routine with the full file and path name of the required file to display the properties.

Download Zipped Project File (5k)

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.