Displaying the File Properties Dialog
Posted
by Lothar A. Haensler
on January 27th, 2004
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 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.

Comments
Extraordinaire
Posted by jperciot on 07/15/2005 02:16am-
Reply
ReplyExtra bis
Posted by jperciot on 07/15/2005 04:37amreading width and height properties of digital media files?
Posted by Legacy on 01/24/2003 12:00amOriginally posted by: Giles
is there any way of reading the width and height properties of digital media files with VB?
.mov
.avi
.mpg
??
ReplyRegistry
Posted by Legacy on 10/01/2002 12:00amOriginally posted by: NetCreativeMind
Proxy, Bandwidth, Registry, Database, C,
ReplyVB, Website, Hardware, Network,
Solutions.
How to get just the revision number
Posted by Legacy on 05/24/2002 12:00amOriginally posted by: Richard Houde
ReplyHow to read file properties programmatically?
Posted by Legacy on 04/02/2002 12:00amOriginally posted by: Robert
Great work! Do you know of a way to read this information programmatically?
ReplyShellExecuteEX
Posted by Legacy on 01/09/2002 12:00amHow can I detect whether the OK button or the Cancel button of the properties dialog has been clicked. The processID seems to be always equal to zero.
ReplyPosition
Posted by Legacy on 12/08/2000 12:00amOriginally posted by: Ingo
How can I positioniering the file properity dialog??
ReplyBut for multiple files ??
Posted by Legacy on 08/02/2000 12:00amOriginally posted by: David Burg
Ok, this is good, but what about a single dialog box for several files like in the windows explorer ? Because the lpName member of the structure is only designed for one file...
ReplyCurrent active Filename
Posted by Legacy on 05/10/2000 12:00amOriginally posted by: Priya
You have given the code for any file name.How do I do it for the current active Filename in my application.
for eg. if the user selects file->properties in my appliaction, it should give the properties for the current active filename.
please help
ReplyThank you
Priya
Displaying the File Properties Dialog
Posted by Legacy on 10/19/1999 12:00amOriginally posted by: Edwin Lima
Excellent:
It'sjust right what I was looking for
Reply