C Program to Hide Mouse Pointer - Graphics Programs

C Program to Hide Mouse Pointer.


C Program to Hide Mouse Pointer Images-Pictures-Photos-Pics-Wall Papers-Snaps-Snap shots-Basic C Programs-C Language Programs-C Program to Hide Mouse Pointer in text mode-Mouse support-General C Programs-Mouse Pointer in text mode-Mouse Support-Graphics Programs.

Int86( ) is a C function that allows to call interrupts in the program.

Prototype in dos.h usage is int86 (int intr num, union REGS *inregs, union REGS *outregs)

in and out register must be type of REGS.

REGS is built in UNION declaration in C.

It is defined in the header file <dos.h>

--------------------------------------------------------------------------------------------------------------------------

#include<graphics.h>
#include<conio.h>
#include<dos.h>
void showmouseptr( );
void hidemouseptr( );
union REGS i,0;
int main( )
{
    int count = 1, gDriver = DETECT, gMode;
    initgraph(&gDriver, &gMode, "C:\\tc\\bgi");
    i.x.ax = 0;
    int86(0X33, &i,&o);
    if(0.x.ax ==0)
    {
       printf("Mouse Support is Unavailable!!");
    }
    else
    {
       showmouseptr( );
       while(count<=10)
       {
          getch( );
          count++;
          if(count%2 ==0)
          hidemouseptr( );
          else
          showmouseptr( );
      }
}
getch( );
return 0;
}
void showmouseptr( )
{
   i.x.ax = 1;
   int 86(0X33, &i, &o);
}
void hidemouseptr( )
{
    i.x.ax = 2;
    int 86(0X33, &i, &o);
}

--------------------------------------------------------------------------------------------------------------------------

Output

--------------------------------------------------------------------------------------------------------------------------

Mouse Support is Unavailable.

--------------------------------------------------------------------------------------------------------

Explanation

--------------------------------------------------------------------------------------------------------------------------


i.x.ax = 0;
int86(0X33,&i,&0);
Will check whether the mouse driver exists or not.
Int 33,0x01 - Show Mouse Cursor
Int 33,0x02 - Hide Mouse Cursor


EmoticonEmoticon