Geoff Chappell - Software Analyst
CURRENT WORK ITEM - PREVIEW ONLY
The ClientExtractIon class is one of many that SHELL32 exposes through its exported DllGetClass function. Instances can therefore be created using such well-documented COM functions as CoCreateInstance, by anyone who knows the CLSID:
CLSID_ClientExtractIcon | {25585DC7-4DA0-438D-AD04-E42C8D2D64B9} |
The class implements the following interfaces:
which are all documented. The IShellFolder interface is implemented trivially: all its methods fail, returning E_NOTIMPL.
The IPersistPropertyBag interface exposes the ClientExtractIcon class to indirect creation through an instance class. Five properties are supported, which are each obtained as values in the one registry key:
Key: | HKEY_CLASSES_ROOT\CLSID\{InstanceClassClsid}\Instance\InitPropertyBag |
Values: | Element InitString opentext properties propertiestext |
The Element value provides the CLSID of an association element which the ClientExtractIcon object is to create and for which the ClientExtractIcon object is to act as a service provider when given IID_IAssociationElement as the service ID. The CLSID may be given in the standard string representation or as 16 bytes of binary data.
Although the facility is provided to specify all types of association element, the intention for ordinary usage may be that the CLSID will be {3C81E7FA-1F3B-464A-A350-114A25BEB2A2} so that the association element is specifically an AssocClientElement. If nothing else, this is perhaps the usage that gives the ClientExtractIcon class its name.
All association elements implement an IPersistString2 interface through which to receive an initialisation string. Indeed, an association element is not initialised until it has been given its initialisation string. This string is specified as the InitString property. The exact interpretation of the initialisation string varies with the type of association element, but the general idea is that it determines a registry key from which the association element draws its settings. Note that this key can be far distant from the instance class’s own key.
The icon location for a ClientExtractIcon object created as an instance class is one such setting. Given that the association element supports querying for the icon location, the answer comes from the DefaultIcon subkey in the association element’s key, wherever that may be:
Key: | element\DefaultIcon |
Value: | default |
The string data is resolved as an icon-location string, in the format interpreted by the SHLWAPI function PathParseIconLocation. Of course, for the ClientExtractIcon object even to be asked the icon location, the instance class’s own key must typically have a shellex\IconHandler subkey whose default value is the instance class’s own CLSID.
The other supported properties are opentext, properties and propertiestext. These support a context menu. Detailed interpretation of string data for these also varies with the type of association element.
The ClientExtractIcon class is implemented in SHELL32 version 6.00 and higher.
Though this class dates from 2001, it was still not documented by Microsoft as late as the January 2007 edition of the Windows Vista Software Development Kit (SDK).