Mouse
#include<stdio.h>
#include<conio.h>
#include<dos.h>
union REGS in,out;
void main()
{
int x,y,cl;
clrscr();
int g=DETECT,m;
initgraph(&g,&m,"c:\\tc\\bgi");
in.x.ax=1;
int86(51,&in,&out);
while(!kbhit())
{
in.x.ax=3;
int86(51,&in,&out);
cl=out.x.bx;
x=out.x.cx;
y=out.x.dx;
gotoxy(29,9);
printf(" ");
gotoxy(10,9);
printf("Mouse Position is: %d , %d",x,y);
printf("\n\n\t Click: %d",cl);
delay(10);
}
getch();
}
Comments
Post a Comment