home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / MOAVOID.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.8 KB  |  63 lines

  1. /**
  2. *
  3. * Name        moavoid -- Hide mouse cursor when in specified region
  4. *
  5. * Synopsis    ercode = moavoid(u_row,u_col,l_row,l_col);
  6. *
  7. *        int ercode      Error return code:
  8. *                    MO_OK if successful;
  9. *                    MO_ABSENT if mouse not found;
  10. *                    MO_RANGE if invalid range specified.
  11. *        unsigned u_row      Top edge of region (0 = top of screen)
  12. *        unsigned u_col      Leftmost edge of region (0 = left edge
  13. *                    of screen).
  14. *        unsigned l_row      Bottom edge of region.
  15. *        unsigned l_col      Right edge of region.
  16. *
  17. * Description    This function hides the mouse cursor if it enters a
  18. *        specified rectangular region of the screen.  The mouse
  19. *        cursor will remain hidden from the time it next enters
  20. *        the region until mnhide(MN_SHOW) is called.
  21. *
  22. *        The normal way to use this function is to call MOAVOID,
  23. *        then perform a screen operation, then call
  24. *        mnhide(MN_SHOW) to restore the mouse cursor.  This
  25. *        function is slightly faster than calling mnhide(MN_HIDE)
  26. *        and will not make the cursor blink off unnecessarily.
  27. *
  28. *        All screen coordinates are specified in pixels relative
  29. *        to (0,0) at the upper left corner of the screen.
  30. *
  31. * Returns    ercode          Error return code:
  32. *                    MO_OK if successful;
  33. *                    MO_ABSENT if mouse not found;
  34. *                    MO_RANGE if invalid range specified.
  35. *        b_mouse       Number of mouse buttons (0 if no driver).
  36. *
  37. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  38. *
  39. **/
  40.  
  41. #include <bmouse.h>
  42.  
  43. int far moavoid(u_row,u_col,l_row,l_col)
  44. unsigned u_row,u_col,l_row,l_col;
  45. {
  46.     int result;
  47.     DOSREG regs;
  48.  
  49.     if (u_row > l_row || u_col > l_col)
  50.     result = MO_RANGE;
  51.     else
  52.     {
  53.     regs.ax = 16;
  54.     regs.cx = u_col;
  55.     regs.dx = u_row;
  56.     regs.si = l_col;
  57.     regs.di = l_row;
  58.     result    = mogate(®s,®s);
  59.     }
  60.  
  61.     return result;
  62. }
  63.