Skip to main content

An Easy Graphics Program to show Mouse pointer.

Here a program to show mouse pointer in dos graphics mode and also sense the clicking effect. Just Enjoy it.
#include<stdio.h>
#include<dos.h>
#include<graphics.h>
#include<conio.h>

void main()
{
 int gd=DETECT,gm,x,y;
 union REGS in,out;

 initgraph(&gd,&gm,"");
 in.x.ax=0;
 int86(0x33,&in,&out);
 in.x.ax=1;
 int86(0x33,&in,&out);
 in.x.ax=3;

 while(!kbhit())
 {
  int86(0x33,&in,&out);
  x=out.x.cx;
  y=out.x.dx;
  
  if(out.x.bx==1)
   putpixel(x,y,RED);
 }
 closegraph();
}
**Before running the program u have 2 copy the file named 'egibgi.bgi' in the current directory.

Comments

Popular posts from this blog

Class Point:: It holds co-ordinates of a point in format (x,y)

A class Named "Point" which stores the Co-ordinates of a point in (x,y) Format. This Class Contains:: O Constructor with default arguments O Copy Constructor O Function to display which Co-ordinate a Point belongs to O Function to get value of x of a point O Function to get value of y of a point O Function to get the Radious Vector (r) of a point O Function to get the Theta of a point O Overloaded Operator - to find out distance between two points O Overloaded Operator >> to take input O Overloaded operator O Destructor #include<iostream.h> #include<math.h> class point{ //Data Members int x,y; //They hold the value of X and Y co-ordinate of a Point. public: //Member Functions point(int t1=0, int t2=0) //Constructor with default arguments. { x=t1; y=t2; } point(point &t) //Copy Constructor { x=t.x; y=t.y; } int coordinate(void); //It returns the point's Co-ordinate, e.g., 1, 2, 3, or 4th. int getx(...