Monday, 20 October 2014

EXCLUSIVE MOUSE PROGRAM FOR BEGINNERS

#include <dos.h>
union REGS in, out;

void showmouse_text ()
{
in.x.ax = 1;
int86 (0X33,&in,&out);
}

int main ()

{
detect_mouse ();
showmouse_text ();
getch ();
return 0; 
}
Mouse Programming in Graphics Mode
Code:
#include <dos.h>
#include <graphics.h>

union REGS in, out;
void showmouse_graphics ()
{
int gdriver = DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
in.x.ax = 1;
int86 (0X33,&in,&out);
getch ();
closegraph ();
}

int main ()
{
detect_mouse ();
showmouse_graphics ();
getch ();
return 0;
}

No comments:

Post a Comment