Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

To show the "properties" for a drive, printer or file.

$
0
0
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"


Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>