How to Change the Mouse Pointer in FoxPro for Windows

ID: Q101585

2.50 2.50a WINDOWS kbinterop

The information in this article applies to:

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

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

Last Reviewed: May 22, 1998