Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

MouGetPtrShape

This call allows a process to get (copy) the pointer shape for the session.

Syntax

 MouGetPtrShape (PtrBuffer, PtrDefRec, DeviceHandle)

Parameters

Number of columns in the mouse shape. In graphics modes, this field contains the pel width (columns) of the mouse shape for the session and must be greater than or equal to 1. In text modes, col must equal 1.

Number of rows in the mouse shape. In graphics modes, this field contains the pel height (rows) of the mouse shape for the session and must be greater than or equal to 1. In text modes, row must equal 1.

This value is returned by the mouse device driver to indicate the relative column offset within the pointer image. The value defines the center (hotspot) of the pointer image. This value is a signed number that represents either character or pel offset, depending on the display mode.

This value is returned by the mouse device driver to indicate the relative row offset within the pointer image. The value defines the center (hotspot) of the pointer image. This value is a signed number that represents either character or pel offset, depending on the display mode.

For all OS/2 system-supported modes, TotLength is specified in bytes and is equal to:

  TotLength = (height in chars) * (width in chars) * 2 * 2
            = 1 * 1 * 2 * 2
            = 4

Length calculations produce byte boundary buffer sizes.

Return Code

rc (USHORT) - return

Return code descriptions are:

Remarks

The application passes a parameter list with the same meaning as defined for MouSetPtrShape to the mouse device driver. The mouse device driver copies the parameters that describe the pointer shape and attributes into the pointer definition control block pointed to by the PtrDefRec parameter. The word 0 (buffer length = TotLength) pointer definition record parameter field must contain the size in bytes of the application buffer where the device driver is to insert the sessions pointer image. All other words in the parameter list are returned to the application by MouGetPtrShape.

If the buffer size is insufficient, the TotLength field contains the actual size in bytes of the returned pointer image.

The pointer shape may be set by the application with MouSetPtrShape or may be the default image provided by the installed Pointer Device Driver.

Bindings

C

typedef struct _PTRSHAPE {  /* moups */
  USHORT cb;                /* total length necessary to build image */
  USHORT col;               /* # of columns in mouse shape */
  USHORT row;               /* number of rows in mouse shape */
  USHORT colHot;            /* column coordinate of pointer image hotspot */
  USHORT rowHot;            /* row coordinate of pointer image hotspot */
} PTRSHAPE;
 
#define INCL_MOU
 
USHORT  rc = MouGetPtrShape(PtrBuffer, PtrDefRec, DeviceHandle);
 
PBYTE       PtrBuffer;     /* Pointer shape buffer */
PPTRSHAPE   PtrDefRec;     /* Pointer definition struct */
HMOU        DeviceHandle;  /* Mouse device handle */
 
USHORT      rc;            /* return code */

MASM

PTRSHAPE struc
  moups_cb      dw  ? ;total length necessary to build image
  moups_col     dw  ? ;# of columns in mouse shape
  moups_row     dw  ? ;number of rows in mouse shape
  moups_colHot  dw  ? ;column coordinate of pointer image hotspot
  moups_rowHot  dw  ? ;row coordinate of pointer image hotspot
PTRSHAPE ends
 
EXTRN  MouGetPtrShape:FAR
INCL_MOU            EQU 1
 
PUSH@  OTHER   PtrBuffer     ;Pointer shape buffer
PUSH@  OTHER   PtrDefRec     ;Pointer definition struct
PUSH   WORD    DeviceHandle  ;Mouse device handle
CALL   MouGetPtrShape
 
Returns WORD