C Program To Check If Mouse Support Is Available Or Not

Sunday, 23 February 2014

Mouse programs using c :- Do everything with mouse using these c programs or source codes, on this page you will find sample mouse programs using c. Programs ranging from how to use mouse in c graphics and in text mode. how to initialize mouse, how to know where the mouse is clicked, which mouse button is clicked i.e left or right, how to restrict mouse pointer. Below is a list of mouse programs made using c language. Mouse interrupt is handled using int 86 function of dos.h header file. All these programs have been made using turbo c compiler.

/* Program to check if mouse driver is loaded or not */

#include <dos.h>
#include <conio.h>
 
int initmouse();
 
union REGS i, o;
 
main()
{
   int status;
 
   status = initmouse();
 
   if ( status == 0 )
      printf("Mouse support not available.\n");
   else
      printf("Mouse support available.\n");
 
   getch();
   return 0;
}
 
int initmouse()
{
   i.x.ax = 0;
   int86(0X33,&i,&o);
   return ( o.x.ax );
}

2 comments

  1. what is that "union" what kind of data type is that and how dose it works ???

    ReplyDelete
    Replies
    1. A union is a special data type available in C that enables you to store different data types in the same memory location. .

      Delete

 

Most Reading