How to Change the Mouse Pointer in FoxPro for Windows

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

SUMMARY

The sample program below shows how to manually change the mouse pointer (cursor) to any of the predefined cursors available in Windows by using the Microsoft Windows application programming interface (API).

MORE INFORMATION

The following program temporarily changes the mouse pointer to an hourglass, and then returns it to the default pointer. You can use the hourglass pointer to indicate that the program is processing information. You can change the mouse pointer to any of the predefined cursors listed in the following program.

   #DEFINE IDC_ARROW       (32512)
   #DEFINE IDC_IBEAM       (32513)
   #DEFINE IDC_WAIT        (32514)
   #DEFINE IDC_CROSS       (32515)
   #DEFINE IDC_UPARROW     (32516)
   #DEFINE IDC_SIZE        (32640)
   #DEFINE IDC_ICON        (32641)
   #DEFINE IDC_SIZENWSE    (32642)
   #DEFINE IDC_SIZENESW    (32643)
   #DEFINE IDC_SIZEWE      (32644)
   #DEFINE IDC_SIZENS      (32645)
   SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL" ADDITIVE
   LOADCSR = REGFN("LOADCURSOR", "IL", "I")
   SETCSR = REGFN("SETCURSOR", "I", "I")
   OLDCSR = CALLFN(SETCSR, CALLFN(LOADCSR, 0, IDC_WAIT))
   FOR I = 1 TO 300000
   NEXT
   =CALLFN(SETCSR, OLDCSR)
   RELEASE LIBRARY SYS(2004)+"FOXTOOLS.FLL"

NOTE: You can find this sample program in the FOXPROW\GOODIES\FOXTOOLS directory under the filename HOURGLAS.PRG.

REFERENCES

Microsoft Windows Software Development Kit (SDK) "Programmer's Reference, Volume 2: Functions," version 3.1


Additional reference words: FoxWin 2.50 2.50a cursor pointer mouse
KBCategory: kbinterop kbtool 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.