@msdn=http://msdn.microsoft.com/en-us/library/bb762231.aspx @pinvoke=http://pinvoke.net/$$$.htm Summary: (from MSDN) Invokes the Properties context menu command on a Shell object. !!!!C# Signature: [DllImport("shell32.dll", SetLastError=true)] static extern bool SHObjectProperties(uint32 hwnd, uint32 shopObjectType, [MarshalAs(UnmanagedType.LPWStr)] string pszObjectName, [MarshalAs(UnmanagedType.LPWStr)] string pszPropertyPage); (not 100% certain this is correct, need to test) !!!!VB Signature: Declare Function SHObjectProperties Lib "shell32.dll" _ (ByVal hwnd As UInt32, ByVal shopObjectType As UInt32, _ <MarshalAs(UnmanagedType.LPWStr)> ByVal pszObjectName As String, _ <MarshalAs(UnmanagedType.LPWStr)> ByVal pszPropertyPage As String) As Boolean !!!!User-Defined Types: Optional Enum used to set shopObjectType for pszObjectName: Public Enum GetProperties SHOP_PRINTERNAME = &H1 '// lpObject points to a printer friendly name SHOP_FILEPATH = &H2 '// lpObject points to a fully qualified path+file name SHOP_VOLUMEGUID = &H4 '// lpObject points to a Volume GUID End Enum !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: Took me forever (okay, less than an hour) to figure out that this function failed with Integers or Longs and it wanted UInt32 for hwnd and shopObjectType. !!!!Tips & Tricks: Please add some! !!!!Sample Code: !!!!!VB Sub Main() ShowProp("C:\boot.ini") 'needed to keep the properties window open (window is bound to current application handle) Console.ReadKey() End Sub Public Enum GetProperties SHOP_PRINTERNAME = &H1 '// lpObject points to a printer friendly name SHOP_FILEPATH = &H2 '// lpObject points to a fully qualified path+file name SHOP_VOLUMEGUID = &H4 '// lpObject points to a Volume GUID End Enum Private Declare Function SHObjectProperties Lib "shell32.dll" _ (ByVal hwnd As UInt32, ByVal shopObjectType As UInt32, _ <MarshalAs(UnmanagedType.LPWStr)> ByVal pszObjectName As String, _ <MarshalAs(UnmanagedType.LPWStr)> ByVal pszPropertyPage As String) As Boolean Public Function ShowProp(ByVal filename As String, Optional ByVal page As String = "") As Boolean If page = String.Empty Then page = 0 Else page = page End If ShowProp = SHObjectProperties(0, GetProperties.SHOP_FILEPATH, filename, String.Empty) End Function Documentation: SHObjectProperties@msdn on MSDN
Edit shell32.SHObjectP...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.