Wednesday, November 4, 2009

Library to enable mouse in 16BIT turboC++ (works upto windows XP)

///////////////////////////////////////////////////////////////
///            MOUSE.H WRITTEN BY RITESH RANJAN        
///            
///         ******************************************    
///            feel free to modify and use it   I would to hear from u abt improvements       
///      ************************************************   
///           ritesh_ranjan007@yahoo.com                 
//////////////////////////////////////////////////////////////////

#include< dos.h >

unsigned int mousex,mousey,mouseb;   // global varialble


void showmouse();
void hidemouse();
void readmouse();
void setmousexy();
void setminmaxx(int ,int);
void setminmaxy(int, int);





//////////////////////////////////////////////////////

void showmouse()
{
   _AX=0x1;
   geninterrupt(0x33);
}
///////////////////////////////////////////////////////
void hidemouse()
{
   _AX=0x2;
   geninterrupt(0x33);
}
//////////////////////////////////////////////////////
void readmouse()
{
  _AX=0x3;
  geninterrupt(0x33);
  mouseb=_BX;
  mousex=_CX;
  mousey=_DX;
}

///////////////// move mouse to x,y /////////////////////
void setmousexy(int x,int y)
{
  _AX=0x4;
  _CX=x;
  _DX=y;
  geninterrupt(0x33);
}
/////////////////// set max min x values /////////////////////////////

void setminmaxx(unsigned int min,unsigned int max)
{
  _AX=0x7;
  _CX=min;
  _DX=max;
  geninterrupt(0x33);
}

////////////////////// set max min y values /////////////////////////

void setminmaxy(unsigned int min,unsigned int max)
{
  _AX=0x8;
  _CX=min;
  _DX=max;
  geninterrupt(0x33);
}
/////////////////////////////////////////////////////////////////

No comments:

Post a Comment