Microsoft KB Archive/19952

Function 2–Hide Cursor PSS ID Number: Q19952 Article last modified on 05-27-1993 PSS database name: H_Mouse

1.x 2.x 3.x 4.x 5.x 6.x 7.x 8.x

MS-DOS

Summary:

This article explains how to use mouse function 2 to erase (or hide) the mouse cursor.

Inputs:

AX = 2

Outputs:

none

More Information:

Function 2 removes the cursor from the screen, if shown, and decrements the internal cursor flag. The cursor continues to track mouse motion, even when hidden.

Note that there is no mouse function that returns the state of the internal cursor flag. However, function 0 initializes the flag to -1.

The cursor should be hidden and then shown again under the following conditions:


 * Screen mode changes (including palette changes).
 * Screen page changes.
 * Before writing to the screen (if the write is over the area where the cursor is shown). If this is not done, the cursor or the written data could be overwritten

Applications that need to track cursor Hide/Show status should use an external variable based upon the number of Hide and Show cursor functions. In most cases, it is preferable that an application leave the mouse cursor hidden (-1) upon exit.

Additional reference words: 7.00 7.04 7.05 8.00 8.10 8.20 9.00

Copyright Microsoft Corporation 1993.