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.
MouSetDevStatus (1.2)
Overview                                            Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_MOU
 
USHORT MouSetDevStatus(pfsDevStatus, hmou)
PUSHORT pfsDevStatus;    /* address of buffer with status */
HMOU hmou;               /* mouse handle                  */
 
The MouSetDevStatus function sets the device status for the specified mouse.
The device status enables or disables the mouse device driver and defines
whether the mouse position is reported in mickeys or in screen units
(character cells or pels).
 
Parameter     Description
────────────────────────────────────────────────────────────────────────────
 
pfsDevStatus  Points to the variable that contains the device status to be
              set. This parameter can be any combination of the following
              values:
 
              Value           Meaning
              ──────────────────────────────────────────────────────────────
              MOUSE_DISABLED  Disable the default mouse device driver. If
                              this value is not given, the function enables
                              the mouse device driver.
 
              MOUSE_MICKEYS   Report mouse motion in mickeys; that is, MS
                              OS/2 reports motion as a number of mickeys
                              moved from the last-reported position. If the
                              value is not given, MS OS/2 reports mouse
                              motion in screen units relative to the
                              upper-left corner of the screen.
 
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 MouSetDevStatus function enables or disables the mouse device driver.
When this device driver is enabled, it draws the pointer by combining the
AND and XOR masks of the pointer shape with the contents of the screen at
the current mouse location. It draws the pointer whenever the mouse moves
(or when an interrupt associated with the mouse occurs). When the mouse
device driver is disabled, the function does not draw the pointer. In such
cases, the process must draw the pointer for itself.
 
The MouSetDevStatus function also directs the mouse to report relative or
absolute positions. If the device is set to report absolute positions, the
x- and y-coordinates given for a mouse position are in screen units relative
to the upper-left corner of the screen. The type of unit depends on the
screen mode. In text mode, the position is given in character cells; in
graphics mode, the position is given in pels. Screen coordinates increase
from left to right on the x-axis and from top to bottom on the y-axis. If
the device is set to report relative positions, the x- and y-coordinates for
a mouse position are given in mickeys and are relative to the most recently
reported position. In this case, the coordinates are signed values, defining
both the direction and distance of the move. The x-coordinate is negative
when the mouse moves left; the y-coordinate is negative when the mouse moves
up.
 
Example
 
This example creates a mouse handle and then calls the MouGetDevStatus
function to set the device status so that mouse-movement information is
returned in terms of mickeys, not pels. This allows the process to obtain
mouse information in terms of relative movement rather than in terms of
absolute pel position:
 
USHORT fsDevStatus = 0x0200;            /* returns mickeys    */
HMOU hmou;
MouOpen(0L, &hmou);
MouSetDevStatus(&fsDevStatus, hmou);    /* sets device status */
 
See Also
 
MouGetDevStatus, MouOpen