CreateCursor

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 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.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.
Link Library: Iconcurs.lib.

See Also

DestroyCursor | GetSystemMetrics | SetCursor

 Last updated on Wednesday, April 14, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.