guides:programming:programmers_reference_manual:cursor_property_gui

CURSOR property (GUI)

Specifies the cursor to use when over a control.

This property can be one of the following formats:

• A path and file name of a cursor (.CUR) file.

• A path and file name to a resource file (such as a DLL) containing the cursor image, along with its resource ID. The resource ID is separated from the file name by a “#” character.

e.g.

.\res\MyAppRes.Dll#192

.\res\MyAppRes.Dll#MYCURSOR

Note that if the cursor image is stored in a custom resource section (rather than the usual CURSOR section) the custom section name may specified by inserting it before the resource name like so:

.\res\MyAppRes.Dll#SOMESECTION#192

.\res\MyAppRes.Dll#SOMESECTION#MYCURSOR

• A symbol that specifies one of the standard Windows cursors. These are:

SymbolDescription
AArrow
HWait
II-Beam (for text entry)
CCross
VVertical (Up) Arrow
&Hand
SApp Starting
?Help
NNo
+Size All
\Size NWSE
/Size NESW
-Size WE
|Size NS
DDragMove
DCDragCopy
""Set to null to use the control's default value.
DevelopmentRuntimeIndexedScaledSynthetic
N/AGet/SetNoNoNo

This property used in response to the windows WM_SETCURSOR message to set the cursor shape when the cursor is over the control.

Note that Windows doesn't always send a WM_SETCURSOR message unless the mouse is moved, so it's possible that you may set the CURSOR property and not see a change. If you need to force a change straight after setting the property use the SYSTEM CURSOR method to do so.

 
// Example - Set the cursor for the current window to an

   // hourglass while it performs a task and then reset it

   // afterwards

   

   Call Set_Property( @Window, "CURSOR", "H" )

   

   // Because the system doesn't send a WM_SETCURSOR message

   // unless the mouse if moved, it can look like the cursor

   // is stuck, so we'll back up that property change with the

   // SYSTEM CURSOR message too, because that change is

   // immediate.

   

   Call Exec_Method( "SYSTEM", "CURSOR", "H" )

   

   GoSub ProcessAllTheThings

   

   // Reset the cursor and force the change...

   Call Set_Property( @Window, "CURSOR", "" )

   Call Exec_Method( "SYSTEM", "CURSOR", "A" )
  • guides/programming/programmers_reference_manual/cursor_property_gui.txt
  • Last modified: 2023/10/25 10:49
  • by 127.0.0.1