HeaderPane
Main

SftPicture2 Documentation

Share Link
Print

Sft_SetPictureIcon

Store an HICON in a SFT_PICTURE as one of the icon-bearing types (SFT_PICTURE_ICON, SFT_PICTURE_ICON_32x32 or SFT_PICTURE_ICON_16x16).

C

void Sft_SetPictureIcon(LPSFT_PICTURE lpPicture, HICON hIcon);
void Sft_SetPictureIcon_32x32(LPSFT_PICTURE lpPicture, HICON hIcon);
void Sft_SetPictureIcon_16x16(LPSFT_PICTURE lpPicture, HICON hIcon);

Parameters

lpPicture

Pointer to a SFT_PICTURE. Must not be NULL.

hIcon

Icon handle. NULL leaves the slot empty (the existing picture is cleared).

Comments

Sft_SetPictureIcon sets type SFT_PICTURE_ICON, which accepts an icon of any size. This is the recommended call for new code.

Sft_SetPictureIcon_32x32 and Sft_SetPictureIcon_16x16 are discontinued variants that set the SFT_PICTURE_ICON_32x32 (alias for SFT_PICTURE_ICON, value 1) and SFT_PICTURE_ICON_16x16 (value 33) types respectively. They exist for back-compatibility with applications written before SFT_PICTURE_ICON accepted any size. New code should use Sft_SetPictureIcon regardless of the icon's pixel dimensions.

Each setter calls Sft_ClearPicture internally before assigning the new icon.

Resource ownership: the application owns the HICON and must keep it alive until the SFT_PICTURE is cleared or the host control is destroyed. Use DestroyIcon to release the icon when the application is done with it.

See Also SftPicture2 | SFT_PICTURE | SFT_PICTURE_ICON | Sft_IsPictureIcon


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.