Gets a cached thumbnail for a given Shell item.
HRESULT GetThumbnail( IShellItem *pShellItem, UINT cxyRequestedThumbSize, WTS_FLAGS flags, ISharedBitmap **ppvThumb, WTS_CACHEFLAGS *pOutFlags, WTS_THUMBNAILID *pThumbnailID );
A pointer to the Shell item for which to retrieve a thumbnail.
The requested thumbnail size in pixels. The maximum value is 1024.
A combination of values from the WTS_FLAGS enumeration. See the Remarks section for rules and a list of possible combinations.
The address of an ISharedBitmap pointer that, when this method returns successfully, receives the object used to access the thumbnail. This parameter may be NULL.
A pointer to a value that, when this method returns successfully, receives a combination of the following flags from the WTS_CACHEFLAGS enumeration.
0x00000001. Set when the returned bitmap dimensions are less than cxyRequestedThumbSize.
0x00000002. Set when the returned image is in the cache.
A pointer to a value that, when this method returns successfully, receives a unique ID for the returned thumbnail. This parameter may be NULL, in which case the thumbnail ID is discarded.
Returns S_OK if successful or a standard COM error value otherwise, including the following:
||A parameter is invalid.|
||The Shell item does not support thumbnail extraction. For example, .exe or .lnk items.|
||The extraction took longer than the maximum allowable time. The extraction was not completed.|
||A surrogate process was not available to be used for the extraction process.|
||The WTS_FASTEXTRACT flag was set, but fast extraction is not available.|
If a thumbnail is extracted, it will be cached unless WTS_EXTRACTDONOTCACHE is specified.
The following combinations are valid for the flags parameter.
|WTS_EXTRACT | WTS_SLOWRECLAIM|
|WTS_FORCEEXTRACTION | WTS_SLOWRECLAIM|
GetImage also uses this cache and can provide an easier way to retrieve the thumbnail. However, GetImage is more general and will retrieve an icon as a fallback.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|