You are here

C program to check if mouse support is available or not

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

C programming code

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