Sunday, November 23, 2008

Display position of pointer in (x coordinate,y coordinate) using c programming language

Q.Write c program which display position of pointer in (x coordinate,y coordinate)?

Ans:
#include
#include
void main()
{
union REGS i,o;
int x,y,k;
//show mouse pointe
i.x.ax=1;
int86(0x33,&i,&o);
while(!kbhit()) //its value will false when we hit key in the key bord
{
i.x.ax=3; //get mouse position
x=o.x.cx;
y=o.x.dx;
clrscr();
printf("(%d , %d)",x,y);
delay(250);
int86(0x33,&i,&o);
}

getch();
}

No comments:

Blog List