subcalls.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MouGetPtrShape (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_MOU
 
USHORT MouGetPtrShape(pbBuffer, pmoupsInfo, hmou)
PBYTE pbBuffer;          /* address of buffer for shape masks          */
PPTRSHAPE pmoupsInfo;    /* address of structure for shape information */
HMOU hmou;               /* mouse handle                               */
 
The MouGetPtrShape function retrieves the AND and XOR masks that define the
shape of the pointer for the specified mouse. MouGetPtrShape also retrieves
information about the pointer, such as the width and height of masks and the
location of the hot spot.
 
Parameter   Description
────────────────────────────────────────────────────────────────────────────
 
pbBuffer    Points to the buffer that receives the masks.
 
pmoupsInfo  Points to the PTRSHAPE structure that receives the pointer
            information.
 
hmou        Identifies the mouse. The handle must have been created
            previously by using the MouOpen function.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_MOUSE_INV_PARMS
     ERROR_MOUSE_NO_DEVICE
 
Comments
 
The MouGetPtrShape function copies the AND and XOR masks to the buffer
pointed to by the pbBuffer parameter. The format and size of the masks
depend on the display device and the video mode. In text mode, each mask is
typically a character/attribute pair. In graphics mode, each mask is a
bitmap.
 
The MouGetPtrShape function copies information about the pointer to the
structure pointed to by the pmoupsInfo parameter. This structure defines the
length (in bytes) of the AND and XOR masks, the width and height of each
mask, and the offset from the current mouse position (or hot spot) to the
upper-left corner of the pointer shape.
 
Before calling MouGetPtrShape, you must set the cb field of the PTRSHAPE
structure to the appropriate buffer size. If the field does not specify an
appropriate size, the function copies the current size to the field and
returns an error without copying the masks to the specified buffer.
 
Example
 
This example creates a mouse handle, draws the mouse pointer, and calls the
MouGetPtrShape function to retrieve the shape of the mouse pointer:
 
PTRSHAPE moupsInfo;
BYTE abBuffer[4];
HMOU hmou;
MouOpen(0L, &hmou);
MouDrawPtr(hmou);
moupsInfo.cb = sizeof(abBuffer);
MouGetPtrShape(abBuffer, &moupsInfo, hmou);
 
See Also
 
MouOpen, MouSetPtrShape, PTRSHAPE