GetIconInfo function

Retrieves information about the specified icon or cursor.

Syntax

BOOL GetIconInfo(
  HICON     hIcon,
  PICONINFO piconinfo
);

Parameters

hIcon

Type: HICON

A handle to the icon or cursor. To retrieve information about a standard icon or cursor, specify one of the following values.

Value Meaning
IDC_APPSTARTING
MAKEINTRESOURCE(32650)
Standard arrow and small hourglass cursor.
IDC_ARROW
MAKEINTRESOURCE(32512)
Standard arrow cursor.
IDC_CROSS
MAKEINTRESOURCE(32515)
Crosshair cursor.
IDC_HAND
MAKEINTRESOURCE(32649)
Hand cursor.
IDC_HELP
MAKEINTRESOURCE(32651)
Arrow and question mark cursor.
IDC_IBEAM
MAKEINTRESOURCE(32513)
I-beam cursor.
IDC_NO
MAKEINTRESOURCE(32648)
Slashed circle cursor.
IDC_SIZEALL
MAKEINTRESOURCE(32646)
Four-pointed arrow cursor pointing north, south, east, and west.
IDC_SIZENESW
MAKEINTRESOURCE(32643)
Double-pointed arrow cursor pointing northeast and southwest.
IDC_SIZENS
MAKEINTRESOURCE(32645)
Double-pointed arrow cursor pointing north and south.
IDC_SIZENWSE
MAKEINTRESOURCE(32642)
Double-pointed arrow cursor pointing northwest and southeast.
IDC_SIZEWE
MAKEINTRESOURCE(32644)
Double-pointed arrow cursor pointing west and east.
IDC_UPARROW
MAKEINTRESOURCE(32516)
Vertical arrow cursor.
IDC_WAIT
MAKEINTRESOURCE(32514)
Hourglass cursor.
IDI_APPLICATION
MAKEINTRESOURCE(32512)
Application icon.
IDI_ASTERISK
MAKEINTRESOURCE(32516)
Asterisk icon.
IDI_EXCLAMATION
MAKEINTRESOURCE(32515)
Exclamation point icon.
IDI_HAND
MAKEINTRESOURCE(32513)
Stop sign icon.
IDI_QUESTION
MAKEINTRESOURCE(32514)
Question-mark icon.
IDI_WINLOGO
MAKEINTRESOURCE(32517)
Application icon.

Windows 2000:  Windows logo icon.

piconinfo

Type: PICONINFO

A pointer to an ICONINFO structure. The function fills in the structure's members.

Return Value

Type: BOOL

If the function succeeds, the return value is nonzero and the function fills in the members of the specified ICONINFO structure.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

GetIconInfo creates bitmaps for the hbmMask and hbmColor members of ICONINFO. The calling application must manage these bitmaps and delete them 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.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

CreateIcon

CreateIconFromResource

CreateIconIndirect

DestroyIcon

DrawIcon

DrawIconEx

ICONINFO

Icons

LoadIcon

LookupIconIdFromDirectory

Reference