Skip to content

Latest commit

 

History

History
443 lines (222 loc) · 11.1 KB

propsys.md

File metadata and controls

443 lines (222 loc) · 11.1 KB

propsys

Module propsys

A module, encapsulating the Vista Property System interfaces

Methods

propsys.PSCreateMemoryPropertyStore

PyIPropertyStore = PSCreateMemoryPropertyStore(riid) Creates a temporary property store that is not connected to any backing storage

Parameters

  • riid=IID_IPropertyStore : PyIID

    The interface to create

Comments

May also be used to create PyINamedPropertyStore, PyIPropertyStoreCache, PyIPersistStream, or PyIPropertyBag

propsys.PSCreatePropertyChangeArray

PyIPropertyChangeArray = PSCreatePropertyChangeArray() Creates an IPropertyChangeArray interface to be used with PyIFileOperation

Comments

Currently only creates an empty array to be filled in later

propsys.PSCreatePropertyStoreFromPropertySetStorage

PyIPropertyStore = PSCreatePropertyStoreFromPropertySetStorage(pss, Mode

, riid

) Wraps a PyIPropertySetStorage interface in a PyIPropertyStore object

Parameters

  • pss : PyIPropertySetStorage

    Property container to be adapted

  • Mode : int

    Read or write mode, shellcon.STGM_*. Must match mode used to open input interface.

  • riid=IID_IPropertyStore : PyIID

    The interface to create

Comments

This function does not work for the NTFS property storage implementation based on

alternate data streams.

propsys.PSCreateSimplePropertyChange

PyIPropertyChange = PSCreateSimplePropertyChange(flags, key

, val

, riid

) Creates an IPropertyChange interface used to apply changes to a PyPROPVARIANT

Parameters

  • flags : int

    The change operation, pscon.PKA_*

  • key : PyPROPERTYKEY

    The property key

  • val : PyPROPVARIANT

    The value that the change operation will apply

  • riid=IID_IPropertyChange : PyIID

    The interface to return.

propsys.PSGetItemPropertyHandler

PyIPropertyStore = PSGetItemPropertyHandler(Item, ReadWrite

, riid

) Retrieves the property store for a shell item

Parameters

  • Item : PyIShellItem

    A shell item

  • ReadWrite=False : bool

    Pass True for a writeable property store

  • riid=IID_IPropertyStore : PyIID

    Interface to return

propsys.PSGetNameFromPropertyKey

string = PSGetNameFromPropertyKey(Key) Retrieves the canonical name of a property

Parameters

propsys.PSGetNamedPropertyFromPropertyStorage

PyPROPVARIANT = PSGetNamedPropertyFromPropertyStorage(ps, name

) Extracts a property value from a serialized buffer by name

Parameters

propsys.PSGetPropertyDescription

PyIPropertyDescription = PSGetPropertyDescription(Key, riid

) Gets a description interface for a property

Parameters

  • Key : PyPROPERTYKEY

    A property key identifier

  • riid=IID_IPropertyDescription : PyIID

    The interface to return

Comments

Possible interfaces include IPropertyDescription, IPropertyDescriptionAliasInfo, and IPropertyDescriptionSearchInfo

propsys.PSGetPropertyFromPropertyStorage

PyPROPVARIANT = PSGetPropertyFromPropertyStorage(ps, key

) Extracts a property value from a serialized buffer by key

Parameters

propsys.PSGetPropertyKeyFromName

PyPROPERTYKEY = PSGetPropertyKeyFromName(Name) Retrieves the property key by canonical name

Parameters

  • Name : str

    The canonical name of a property (eg System.Author)

propsys.PSGetPropertySystem

PyIPropertySystem = PSGetPropertySystem(riid) Creates an IPropertySystem interface

Parameters

  • riid=IID_IPropertySystem : PyIID

    The interface to return

propsys.PSLookupPropertyHandlerCLSID

PyIID = PSLookupPropertyHandlerCLSID(FilePath) Returns the GUID of the property handler for a file

Parameters

  • FilePath : str

    Name of file

Comments

If no handler is found, the returned error code can be deceptive as it seems to indicate

that the file itself was not found

propsys.PSRegisterPropertySchema

PSRegisterPropertySchema(filename) Registers a group of properties described in a schema file

Parameters

  • filename : unicode

    An XML file that defines a property schema (*.propdesc)

propsys.PSUnregisterPropertySchema

PSUnregisterPropertySchema(filename) Removes a property schema definition

Parameters

  • filename : unicode

    A previously registered schema definition file

propsys.SHGetPropertyStoreForWindow

PyIPropertyStore = SHGetPropertyStoreForWindow(hwnd, riid

) Retrieves a collection of a window's properties

Parameters

  • hwnd : PyHANDLE

    Handle to a window

  • riid=IID_IPropertyStore : PyIID

    The interface to create

Comments

Requires Windows 7 or later.

Return Value

The returned store can be used to set the System.AppUserModel.ID property that determines how windows

are grouped on the taskbar

propsys.SHGetPropertyStoreFromParsingName

PyIPropertyStore = SHGetPropertyStoreFromParsingName(Path, BindCtx

, Flags

, riid

) Retrieves the property store for an item by path

Parameters

  • Path : string

    Path to file

  • BindCtx=None : PyIBindCtx

    Bind context, or None

  • Flags=GPS_DEFAULT : int

    Combination of GETPROPERTYSTOREFLAGS values (shellcon.GPS_*)

  • riid=IID_IPropertyStore : PyIID

    The interface to return

Comments

This function does not exist on XP, even with Desktop Search installed

propsys.SHSetDefaultProperties

SHSetDefaultProperties(hwnd, Item, FileOpFlags, Sink) Sets the default properties for a file.

Parameters

Comments

Default properties are registered by filetype under SetDefaultsFor value.

propsys.StgDeserializePropVariant

PyPROPVARIANT = StgDeserializePropVariant(prop) Creates a PyPROPVARIANT from a serialized buffer

Parameters

  • prop : bytes

    Buffer or bytes object (or str in Python 2) containing a serialized value

propsys.StgSerializePropVariant

bytes = StgSerializePropVariant(propvar) Serializes a PyPROPVARIANT

Parameters