Microsoft Windows CE 3.0  

CreateCursor

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This function creates a cursor having the specified size, bit patterns, and hot spot.

HCURSOR CreateCursor(
HINSTANCE
hInst
,
int
xHotSpot
,
int
yHotSpot
,
int
nWidth
,
int
nHeight
,
CONST VOID *
pvANDPlane
,
CONST VOID *
pvXORPlane
);

Parameters

hInst
[in] Handle to the current instance of the application creating the cursor.
xHotSpot
[in] Specifies the horizontal position of the cursor's hot spot.
yHotSpot
[in] Specifies the vertical position of the cursor's hot spot.
nWidth
[in] Specifies the width, in pixels, of the cursor.
nHeight
[in] Specifies the height, in pixels, of the cursor.
pvANDPlane
[in] Void pointer to an array of bytes that contains the bit values for the AND bitmask of the cursor, as in a device-dependent monochrome bitmap.
pvXORPlane
[in] Void pointer to an array of bytes that contains the bit values for the XOR bitmask of the cursor, as in a device-dependent monochrome bitmap.

Return Values

A handle to the cursor indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

Hotspots should be created with positive location values. If the xHotSpotor yHotSpotparameter has a negative value, the actual hotspot has an arbitrary position.

The nWidthand nHeightparameters must specify a width and height that are supported by the current display driver, because the system cannot create cursors of other sizes. To determine the width and height supported by the display driver, use the GetSystemMetricsfunction, specifying the SM_CXCURSOR or SM_CYCURSOR value.

Before closing, an application must call the DestroyCursorfunction to free any system resources associated with the cursor.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Iconcurs.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

DestroyCursor, GetLastError, GetSystemMetrics, SetCursor