This function creates a cursor having the specified size, bit patterns, and hot spot.
At a Glance
Header file: | Winuser.h |
Windows CE versions: | 1.0 and later |
Syntax
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 xHotSpot or yHotSpot parameter has a negative value, the actual hotspot has an arbitrary position.
The nWidth and nHeight parameters 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 GetSystemMetrics function, specifying the SM_CXCURSOR or SM_CYCURSOR value.
Before closing, an application must call the DestroyCursor function to free any system resources associated with the cursor.
See Also