CURSOR property (GUI)
Description
Specifies the cursor to use when over a control.
Property Value
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:
Symbol | Description |
---|---|
A | Arrow |
H | Wait |
I | I-Beam (for text entry) |
C | Cross |
V | Vertical (Up) Arrow |
& | Hand |
S | App Starting |
? | Help |
N | No |
+ | Size All |
\ | Size NWSE |
/ | Size NESW |
- | Size WE |
| | Size NS |
D | DragMove |
DC | DragCopy |
"" | Set to null to use the control's default value. |
Property Traits
Development | Runtime | Indexed | Scaled | Synthetic |
---|---|---|---|---|
N/A | Get/Set | No | No | No |
Remarks
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
// 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" )