Jump to content
Sign in to follow this  
c.haslam

GUISetCursor not working for me

Recommended Posts

c.haslam

#include <GUIConstants.au3>

$Form1 = GUICreate("Form 1", 300, 300, 200, 200 )
$btn = GUICtrlCreateButton("Change cursor",20,20,100,40)
$lbl = GUICtrlCreateLabel("Arrow     ",20,100)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $btn
        fn()
    EndSwitch
WEnd

Func fn()
Local $Cursor_WAIT = 15
    GUISetCursor($Form1,$Cursor_WAIT,1)
    GUICtrlSetData($lbl,"Hourglass")
    sleep(3000)
    GUISetCursor($form1,2,1)
    GUICtrlSetData($lbl,"Arrow")
EndFunc

Why does the cursor not change to an hourglass?

...chris


Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Share this post


Link to post
Share on other sites
Achilles

I'm not sure what you were thinking as for parameters, but they have to be in order. Try this:

#include <GUIConstants.au3>

$Form1 = GUICreate("Form 1", 300, 300, 200, 200 )
$btn = GUICtrlCreateButton("Change cursor",20,20,100,40)
$lbl = GUICtrlCreateLabel("Arrow     ",20,100)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $btn
        fn()
    EndSwitch
WEnd

Func fn()
Local $Cursor_WAIT = 15
    GUISetCursor($Cursor_WAIT, 1)
    GUICtrlSetData($lbl,"Hourglass")
    sleep(3000)
    GUISetCursor(2, 1)
    GUICtrlSetData($lbl,"Arrow")
EndFunc

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×