Hi,Friends i want to show that how to initialize mouse in c language and in turbo c/c++ compiler
code is here.
- #include < stdio.h >
- #include < conio.h >
- #include < dos.h >
- union REGS in , out;
- void mouse_setposi(int * xpos, int * ypos)
- {
- in .x.ax = 4; in .x.cx = * xpos; in .x.dx = * ypos;
- int86(51, & in , & out);
- }
- int mouse_callmouse()
- {
- in .x.ax = 1;
- int86(51, & in , & out);
- return 1;
- }
- void main()
- {
- int a, b, xpos, ypos, click;
- clrscr();
- a = 300;
- b = 80;
- mouse_setposi( & a, & b);
- mouse_callmouse();
- getch();
- }
Now copy this code and paste into any .c file and save in "C:\TURBOC3\BIN" directory and you can download zip file that have already a .c file paste it into directory. after that open turbo c/c++ compiler and open this file and run ... :)