0 out of 1 rated this helpful - Rate this topic

CreateIconIndirect function

Applies to: desktop apps only

Creates an icon or cursor from an ICONINFO structure.

Syntax

HICON WINAPI CreateIconIndirect(
  __in  PICONINFO piconinfo
);

Parameters

piconinfo [in]

Type: PICONINFO

A pointer to an ICONINFO structure the function uses to create the icon or cursor.

Return value

Type: HICON

If the function succeeds, the return value is a handle to the icon or cursor that is created.

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

Remarks

The system copies the bitmaps in the ICONINFO structure before creating the icon or cursor. Because the system may temporarily select the bitmaps in a device context, the hbmMask and hbmColor members of the ICONINFO structure should not already be selected into a device context. The application must continue to manage the original bitmaps and delete them when they are no longer necessary.

When you are finished using the icon, destroy it using the DestroyIcon function.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
DestroyIcon
ICONINFO
Conceptual
Icons

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ