To show the "properties" for a drive, printer or file.
Code:
Public Enum SHOP_Flags
SHOP_PRINTERNAME = &H1 'pszObjectName points to a printer friendly name
SHOP_FILEPATH = &H2 'pszObjectName points to a fully qualified path+file name
SHOP_VOLUMEGUID = &H4 'pszObjectName points to a Volume GUID
End Enum
Public Declare Function SHObjectProperties Lib "shell32.dll" (ByVal hWnd As Long, ByVal shopObjectType As SHOP_Flags, ByVal pszObjectName As Long, ByVal pszPropertyPage As Long) As Long
Public Function GetObjectProperties(ByVal hwndOwner As Long, ByVal ShowFlags As SHOP_Flags, ByVal sNameOrPath As String) As Boolean
GetObjectProperties = SHObjectProperties(hwndOwner, ShowFlags, StrPtr(sNameOrPath), StrPtr(" "))
End Function
GetObjectProperties Me.hWnd, SHOP_FILEPATH, "c:\windows\explorer.exe"
Re: To show the "properties" for a drive, printer or file.
Nice, had forgotten that function took a volume guid or printer too.
See also: SHMultiFileProperties; how to create the 'Properties' dialog for more than one file at a time. Example
1 Attachment(s)
Re: To show the "properties" for a drive, printer or file.
Thanx :)
The did forgot to set an example for the last param in that API which tells which tab that will be selected. (0 or strptr(" ") is default the first tab.
Code:
Public Function GetObjectProperties(ByVal hwndOwner As Long, ByVal ShowFlags As SHOP_Flags, ByVal sNameOrPath As String, Optional ByVal sActiveTab As String = " ") As Boolean
GetObjectProperties = SHObjectProperties(hwndOwner, ShowFlags, StrPtr(sNameOrPath), StrPtr(sActiveTab & Chr(0)))
End Function
Re: To show the "properties" for a drive, printer or file.
put the name of the tab
It depends on the language, in my case Spanish.
Re: To show the "properties" for a drive, printer or file.
Yes, indeed but 0 or strptr(” ”) is default tab. The first leftmost tab.