Microsoft KB Archive/19872

How to Access Microsoft Mouse Driver from C PSS ID Number: Q19872 Article last modified on 05-14-1993 PSS database name: H_Mouse

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

MS-DOS

Summary:

The following are four basic methods for accessing the Microsoft Mouse driver from Microsoft C.

More Information:

Method 1
For this method, (for any of the memory models), any MOUSE.LIB procedure may be used (with certain restrictions as noted in the Microsoft Mouse Programmer’s Reference) to get to the mouse driver. Method 1 carries a certain amount of overhead: pointers of arguments must be passed to the MOUSE.LIB function, which gets the values, checks for mouse driver present, and loads the values, INT’s mouse, and returns the values to the pointed to arguments.

Method 2
This method is through the “intdos” or “intdosx” C library functions. “Intdos” allows AX-DX parameters only. “Intdosx” allows the segment registers to be accessed. Method 2 carries the overhead involved in handling the REGS unions (saving, loading, restoring registers).

Method 3
This method is to link a MASM subroutine into the C run time, where the MASM routine is specially designed to do the appropriate activities. Method 3 is recommended for actual function 12 subroutines. Method 3 may be used to optimize the access time overhead according to what you want.

Method 4
This method is to use inline assembler code if your version of C supports this functionality. This works well to speed up your code, instead of calling intdos or intdosx.

All of these methods work correctly, and all are efficient for most general purposes.

Additional reference words: 6.00 7.00 7.03 7.04 7.05 8.00 8.10 8.20 9.00

Copyright Microsoft Corporation 1993.