home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_01_03
/
1n03078a
< prev
next >
Wrap
Text File
|
1990-07-12
|
763b
|
30 lines
#include <dos.h>
/******************************************************************
* CheckMouse - check for presence of Microsoft mouse driver
* Returns: 0 if mouse driver found
* -1 if mouse driver not found
* Code based on Microsoft Mouse Programmer's Reference Guide
*
* Copyright: Original code by William H. Roetzheim
********************************************************************
*/
int CheckMouse()
{
union REGS regs;
struct SREGS sregs;
long address;
char byte;
/* Get interrupt vector */
regs.x.ax = 0x3533;
intdosx(®s, ®s, &sregs);
address = (((long) sregs.es) << 16) + (long) regs.x.bx;
byte = *(long far *)address;
if ((address == 0) || (byte == 0xcf)) {
return -1;
}
else return 0;
}