Aug 14, 2012

C program to hide the mouse pointers.

C program to hide the mouse pointers.
In this program, we hide the mouse pointers using graphics.h and dos.h library functions.
To use graphics.h, we have to install the drivers in to the the system by using the initgraph() function.
In this program,we also check the condition that mouse pointer is available or not. Read more about C Programming Language . and read the C Programming Language (2nd Edition). by K and R.
/***********************************************************
* You can use all the programs on  www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
* 
*                      Happy Coding
***********************************************************/

#include<graphics.h>
#include<conio.h>
#include<dos.h>

void showmouseptr();
void hidemouseptr();

union REGS i, o;

int main()
{
    int  count = 1, gd = DETECT, gm;
    
    initgraph(&gd,&gm,"C:\\TC\\BGI");/*check your path, to install the drivers in to the the system*/
    
    i.x.ax = 0;
    int86(0X33,&i,&o);
    if(o.x.ax == 0)
    {
        printf("\n\t Sorry! Mouse support not available !");
    }
    else
    {
        showmouseptr();
        
        while(count<=10)
        {
            getch();
            count++;
            if(count%2==0)
            hidemouseptr();
            else
            showmouseptr();
        }
    }
    
    getch();
    return 0;
}


void showmouseptr()
{
    i.x.ax = 1;
    int86(0X33,&i,&o);
}

void hidemouseptr()
{
    i.x.ax = 2;             // to hide mouse
    int86(0X33,&i,&o);
}
Read more Similar C Programs
 
Graphics in C

C Strings

C Aptitude
You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it


(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!
To browse more C Programs visit this link