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
This call queries the mouse driver to determine the current row and column coordinate position of the mouse pointer.
MouGetPtrPos(PtrPos, DeviceHandle);
rc (USHORT) - return:Return code descriptions are:
For a text window (VIO) application, the text window is a view on the larger logical video buffer (LVB). The mouse pointer can be outside that view and still be within the extent of the LVB. MouGetPtrPos then returns the coordinates of the cell under the mouse pointer. If the pointer is outside the LVB image extent, the coordinates of the nearest LVB cell are returned. In either case, the LVB is scrolled until the reported LVB cell appears within the view window.
typedef struct _PTRLOC { /* moupl */ USHORT row; /* pointer row coordinate screen position */ USHORT col; /* pointer column coordinate screen position */ } PTRLOC; #define INCL_MOU USHORT rc = MouGetPtrPos(PtrPos, DeviceHandle); PPTRLOC PtrPos; /* Double word structure */ HMOU DeviceHandle; /* Mouse device handle */ USHORT rc; /* return code */
PTRLOC struc moupl_row dw ? ;pointer row coordinate screen position moupl_col dw ? ;pointer column coordinate screen position PTRLOC ends EXTRN MouGetPtrPos:FAR INCL_MOU EQU 1 PUSH@ OTHER PtrPos ;Double word structure PUSH WORD DeviceHandle ;Mouse device handle CALL MouGetPtrPos Returns WORD
#define INCL_MOU #include <os2.h> PPTRLOC PtrPos; /* Pointer to the mouse pointer data structure. */ HMOU DeviceHandle; /* Reserved. Must be 0. */ APIRET rc; /* Return code. */ rc = MouGetPtrPos(PtrPos, DeviceHandle);