Shell Functions


SHGetStockIconInfo Function

Retrieves information about system-defined Shell icons.

Syntax

HRESULT SHGetStockIconInfo(      
    SHSTOCKICONID siid,     UINT uFlags,     SHSTOCKICONINFO *psii );

Parameters

siid
One of the values from the SHSTOCKICONID enumeration that specifies which icon should be retrieved.
uFlags
A combination of zero or more of the following flags that specify which information is requested.
SHGSI_ICONLOCATION
The szPath and iIcon members of the SHSTOCKICONINFO structure receive the path and icon index of the requested icon, in a format suitable for passing to the ExtractIcon function. The numerical value of this flag is zero, so you always get the icon location regardless of other flags.
SHGSI_ICON
The hIcon member of the SHSTOCKICONINFO structure receives a handle to the specified icon.
SHGSI_SYSICONINDEX
The iSysImageImage member of the SHSTOCKICONINFO structure receives the index of the specified icon in the system imagelist.
SHGSI_LINKOVERLAY
Modifies the SHGSI_ICON value by causing the function to add the link overlay to the file's icon.
SHGSI_SELECTED
Modifies the SHGSI_ICON value by causing the function to blend the icon with the system highlight color.
SHGSI_LARGEICON
Modifies the SHGSI_ICON value by causing the function to retrieve the large version of the icon, as specified by the SM_CXICON and SM_CYICON system metrics.
SHGSI_SMALLICON
Modifies the SHGSI_ICON value by causing the function to retrieve the small version of the icon, as specified by the SM_CXSMICON and SM_CYSMICON system metrics.
SHGSI_SHELLICONSIZE
Modifies the SHGSI_LARGEICON or SHGSI_SMALLICON values by causing the function to retrieve the Shell-sized icons rather than the sizes specified by the system metrics.
psii
[in, out] A pointer to a SHSTOCKICONINFO structure. When this function is called, the cbSize member of this structure needs to be set to the size of the SHSTOCKICONINFO structure. When this function returns, contains a pointer to a SHSTOCKICONINFO structure that contains the requested information.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If this function returns an icon handle in the hIcon member of the SHSTOCKICONINFO structure pointed to by psii, you are responsible for freeing the icon with DestroyIcon when you no longer need it.

Function Information

Minimum DLL VersionShell32.dll
Custom ImplementationNo
Headershellapi.h
Import libraryNone
Minimum operating systems Windows Vista
Tags :


Page view tracker