You are here

C program to display mouse pointer in textmode

/* Program to display mouse-pointer in text-mode */

  1. #include<dos.h>
  2. #include<conio.h>
  3.  
  4. int initmouse();
  5. void showmouseptr();
  6.  
  7. union REGS i, o;
  8.  
  9. main()
  10. {
  11.    int status;
  12.  
  13.    status = initmouse();
  14.  
  15.    if (status == 0)
  16.       printf("Mouse support not available.\n");
  17.    else
  18.       showmouseptr();
  19.  
  20.    getch();
  21.    return 0;
  22. }
  23.  
  24. int initmouse()
  25. {
  26.    i.x.ax = 0;
  27.    int86(0X33, &i, &o);
  28.    return (o.x.ax);
  29. }
  30.  
  31. void showmouseptr()
  32. {
  33.    i.x.ax = 1;
  34.    int86(0X33, &i, &o);
  35. }