GetIconInfoExW function (winuser.h)

Retrieves information about the specified icon or cursor. GetIconInfoEx extends GetIconInfo by using the newer ICONINFOEX structure.

Syntax

BOOL GetIconInfoExW(
  [in]      HICON        hicon,
  [in, out] PICONINFOEXW piconinfo
);

Parameters

[in] hicon

Type: HICON

A handle to the icon or cursor.

To retrieve information about a standard icon or cursor, specify the identifier beginning with the IDI_ prefix or the identifier beginning with the IDC_ prefix in this parameter.

[in, out] piconinfo

Type: PICONINFOEX

When this method returns, contains a pointer to an ICONINFOEX structure. The function fills in the structure's members.

Return value

Type: BOOL

TRUE indicates success, FALSE indicates failure.

Remarks

GetIconInfoEx creates bitmaps for the hbmMask and hbmColor or members of ICONINFOEX. The calling application must manage these bitmaps and delete them with DeleteObject call when they are no longer necessary.

DPI Virtualization

This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread.

Note

The winuser.h header defines GetIconInfoEx 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.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See also

Conceptual

Bitmaps

Icons

DeleteObject

GetObject

BITMAP

CreateIcon

CreateIconFromResource

CreateIconIndirect

DestroyIcon

DrawIcon

DrawIconEx

LoadIcon

LookupIconIdFromDirectory

ICONINFO