Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
CURSORSHAPE
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
typedef struct tagCURSORSHAPE {
    short csHotX;
    short csHotY;
    short csWidth;
    short csHeight;
    short csWidthBytes;
    short csColor;
    char  csBits[1];
} CURSORSHAPE;
 
The CURSORSHAPE structure contains information that Windows uses to generate
a cursor at the current cursor position. The cursor information includes two
bitmaps, called the AND and XOR bitmaps, that Windows combines with screen
bits (using the bitwise AND and XOR operations) to create the cursor image.
 
Member        Description
────────────────────────────────────────────────────────────────────────────
 
csHotX        Specifies the x-coordinate (relative to the upper-left corner
              of the cursor bitmap) of the cursor hotspot. Negative
              coordinates specify a hotspot that lies outside the cursor
              shape.
 
csHotY        Specifies the y-coordinate (relative to the upper-left corner
              of the cursor bitmap) of the cursor hotspot. Negative
              coordinates specify a hotspot that lies outside the cursor
              shape.
 
csWidth       Specifies the width of the cursor shape in pixels.
 
csHeight      Specifies the height of the cursor shape in raster lines.
 
csWidthBytes  Specifies the width of the cursor shape in bytes.
 
csColor       Specifies the format of color information in following pixel
              array. This field should contain zero.
 
csBits        Specifies an array of bits containing the AND and XOR bitmaps
              that define the cursor shape. The AND bitmap is stored first;
              the XOR bitmap second. Each bitmap is csHeight*csWidthBytes
              bytes. The bitmap bits are stored raster line by raster line,
              with the raster line representing the top of the bitmap given
              first.
 
Comments
 
When Windows draws the cursor, it calculates the screen coordinates of the
top-left corner of the cursor image by subtracting the cursor hotspot
coordinates from the current cursor position. It then combines the bits of
the AND bitmap with the screen bits by using the bitwise AND operator and
combines the bits of the XOR bitmap with the result by using the bitwsie XOR
operator.
 
 
                                      ♦