Share via


CreateIconIndirect

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function creates an icon or cursor from an ICONINFO structure.

Syntax

HICON CreateIconIndirect(
  PICONINFO piconinfo
);

Parameters

  • piconinfo
    [in] Pointer to an ICONINFO structure the function uses to create the icon or cursor.

Return Value

A handle to the icon or cursor that is created indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

The system copies the bitmaps in the ICONINFO structure before creating the icon. 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 using Iconcurs.dll, call this function to create either icons or monochrome cursors. Windows Embedded CE does not support color cursors.

Hotspots should be created with positive location values. If a hotspot is created with negative location values, there is no way to determine where it appears.

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

Requirements

Header winuser.h
Library Icon.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

DestroyIcon
DrawIcon
ICONINFO
LoadIcon