SHUpdateImageA function (shlobj_core.h)

Notifies the Shell that an image in the system image list has changed.


void SHUpdateImageA(
  [in] LPCSTR pszHashItem,
  [in] int    iIndex,
  [in] UINT   uFlags,
  [in] int    iImageIndex


[in] pszHashItem


A pointer to a string value that specifies the fully qualified path of the file that contains the icon. Use the path that is returned in the buffer pointed to by the szIconFile parameter of IExtractIcon::GetIconLocation.

[in] iIndex

Type: int

An integer that specifies the zero-based index of the icon in the file specified by pszHashItem. Use the value that is pointed to by the piIndex parameter of IExtractIcon::GetIconLocation.

[in] uFlags

Type: UINT

An unsigned integer that specifies the flags that determine the icon attributes. Set uFlags to the value that is pointed to by the pwFlags parameter of IExtractIcon::GetIconLocation. The flags that are relevant to SHUpdateImage are GIL_NOTFILENAME and GIL_SIMULATEDOC.

[in] iImageIndex

Type: int

An integer that specifies the index in the system image list of the icon that is being updated.

Return value



If you do not know the index in the system image list of the icon that you want to update, use SHGetFileInfo with the uFlags parameter set to SHGFI_SYSICONINDEX.

You must use IExtractIcon::GetIconLocation with the parameters of the old icon that needs to be updated, not those of the new icon you want to replace it with.


The shlobj_core.h header defines SHUpdateImage as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h, Shlobj_core.h)
Library Shell32.lib
DLL Shell32.dll (version 4.7 or later)

See also