ImageList_ReplaceIcon function (commctrl.h)
Replaces an image with an icon or cursor.
int ImageList_ReplaceIcon( [in] HIMAGELIST himl, [in] int i, [in] HICON hicon );
A handle to the image list.
The index of the image to replace. If i is -1, the function appends the image to the end of the list.
The handle to the icon or cursor that contains the bitmap and mask for the new image.
Returns the index of the image if successful, or -1 otherwise.
Because the system does not save hicon, you can destroy it after the function returns if the icon or cursor was created by the CreateIcon function. You do not need to destroy hicon if it was loaded by the LoadIcon function; the system automatically frees an icon resource when it is no longer needed.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|API set||ext-ms-win-shell-comctl32-init-l1-1-1 (introduced in Windows 10, version 10.0.14393)|