Simulating SET MOUSE ON|OFF in FoxPro for Windows

Last reviewed: April 29, 1996
Article ID: Q99608
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY

In FoxPro for MS-DOS, the SET MOUSE ON|OFF command is used to enable or disable the presence of the mouse cursor on the screen. In FoxPro for Windows, this command is ignored, since all mouse functions are controlled by the Windows operating environment.

You can simulate SET MOUSE ON|OFF in FoxPro for Windows by making the appropriate Windows application programming interface (API) calls. The following code snippet disables or enables the mouse based on the value of the variable "enable" (0 to disable, 1 to enable):

   SET LIBRARY TO SYS(2004)+"foxtools.fll" ADDITIVE
   enable=1
   mouse_cur= RegFn("showcursor", "I", "I")
   showcursor= CallFn(mouse_cur, enable)
   IF enable=0
     DO WHILE showcursor>=0
        showcursor= CallFn(mouse_cur, enable)
     ENDDO
   ELSE
     showcursor= CallFn(mouse_cur, enable)
   ENDIF
   RELEASE LIBRARY SYS(2004)+"foxtools.fll"

MORE INFORMATION

WARNING: The functions provided in FOXTOOLS.FLL are not supported by Microsoft. They were developed for internal use only and are provided here, as is, for the benefit of our customers. We make no warranty, implied or otherwise, regarding the performance or reliability of these functions.

The ShowCursor() API function sets an internal display counter that determines whether the cursor should be displayed. When the display counter is greater than or equal to 0 (zero), the mouse cursor will be displayed. When the display counter is -1, the mouse cursor will not be displayed. If you pass a 0 to the ShowCursor() function, the display counter is decremented by 1; to turn the mouse cursor off, you must continue to call the function until the display counter equals -1.

REFERENCES

Microsoft Windows Software Development Kit "Programmer's Reference, Volume 1: Overview," version 3.1

Microsoft FoxPro "Language Reference," version 2.5


Additional reference words: FoxWin 2.50 2.50a show cursor sdk
KBCategory: kbprg kbcode
KBSubcategory: FxprgFoxtools


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.