Below is the C program display mouse pointer in graphics mode. Here we have used 2 functions to achieve it.
int initmouse() : function is used to intialize the mouse pointer. Which returns int value. Value 0 indicates Mouse support is not available.
void showmousepointer() : function is used to show mouse pointer. Which does not return any value.
int initmouse() : function is used to intialize the mouse pointer. Which returns int value. Value 0 indicates Mouse support is not available.
void showmousepointer() : function is used to show mouse pointer. Which does not return any value.
Code:
#include<graphics.h> #include<conio.h> #include<dos.h> int initmouse(); void showmousepointer(); union REGS i, o; main() { int status, gd = DETECT, gm; initgraph(&gd,&gm,"C:\\TC\\BGI"); status = initmouse(); if ( status == 0 ) printf("Mouse support not available.\n"); else showmousepointer(); getch(); return 0; } int initmouse() { i.x.ax = 0; int86(0X33,&i,&o); return ( o.x.ax ); } void showmousepointer() { i.x.ax = 1; int86(0X33,&i,&o); }
0 Comments