Simulating SET MOUSE ON|OFF in FoxPro for Windows

ID: Q99608

2.50 2.50a WINDOWS

The information in this article applies to:

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: KBSubcategory: FxprgFoxtools

Keywords          : kbcode FxprgFoxtools 
Version           : 2.50 2.50a
Platform          : WINDOWS

Last Reviewed: May 22, 1998