Category : C Source Code
Archive   : MOUSY.ZIP
Filename : MMOUSE.C

 
Output of file : MMOUSE.C contained in archive : MOUSY.ZIP
/* Look for handler, display mouse co-ordinates and button status */
/* Information was obtained from "The Microsoft Mouse Programmers Ref" */
/* Microsoft Press, 1990. Program by Rick Davis, NIOSH */

#include
#include
#include
main()
{
union REGS iReg,oReg;
void (interrupt far *int_handler)();
long vector;
unsigned char first_byte;

int_handler = _dos_getvect(0x33);
first_byte = * (unsigned char far *) int_handler;
vector=(long) int_handler;

if((vector==0) || (first_byte == 0xcf)){
printf("\nMouse handler not installed\n");
exit();
}
iReg.x.ax = 0;
int86(0x33,&iReg,&oReg);
if(oReg.x.ax == -1){
printf("\nMouse handler WAS found\n");
}
else{
printf("\n Mouse handler not found \n");
exit();
}
printf("\nShow cursor");
iReg.x.ax = 1;
int86(0x33,&iReg,&oReg);
while(!kbhit()){
iReg.x.ax=3;
int86(0x33,&iReg,&oReg);
printf("\rMouse virtual co-ords=\t%d,\t%d",oReg.x.cx,oReg.x.dx);
printf(" buttons hex = \t%x",oReg.x.bx);
}
}


  3 Responses to “Category : C Source Code
Archive   : MOUSY.ZIP
Filename : MMOUSE.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/