Jump to content

Busy cursor not shown when hovering over control items


AndyS01
 Share

Recommended Posts

When I set the busy cursor on the main gui, it returns to a normal cursor when hovering over any of the controls on the gui window.  This behavior happens regardless of whether I set the 'override' parameter to 1 or to 0.
Here is my test code:

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_UseX64=N

Opt("GUICloseOnESC", 1) ; ESC closes GUI? (0 = no, 1 = yes)
Opt("GUIOnEventMode", 1) ; Change to OnEvent mode
Opt('MustDeclareVars', 1)
OnAutoItExitRegister("Event_GUIClose")

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $hMainWin, $statusID, $cnt = 0

_Main()

Func _Main()
    Local $msg

    $hMainWin = GUICreate("cursor test", 250, 200, -1, -1)

    GUICtrlCreateListView("ABCdef", 10, 10, 100, 100)

    GUICtrlCreateButton("override = 1", 130, 10, 100, 25)
    GUICtrlSetOnEvent(-1, "handle_SetCur_1_btn")

    GUICtrlCreateButton("override = 0", 130, 50, 100, 25)
    GUICtrlSetOnEvent(-1, "handle_SetCur_0_btn")

    $statusID = GUICtrlCreateLabel("", 10, 120, 200, 20)
    GUICtrlSetBkColor(-1, 0xFFFF00)

    GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose')

    GUISetState() ; Make everything visible

    While (1)
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
        EndSelect
        Sleep(125)
    WEnd

EndFunc   ;==>_Main

Func Event_GUIClose()
    Exit
EndFunc   ;==>Event_GUIClose

Func handle_SetCur_1_btn()

    If (Mod($cnt, 2)) Then
        setIT(15, 1)
    Else
        setIT(2, 1)
    EndIf

    $cnt += 1
EndFunc   ;==>handle_SetCur_1_btn

Func handle_SetCur_0_btn()
    If (Mod($cnt, 2)) Then
        setIT(15, 0)
    Else
        setIT(2, 0)
    EndIf
    $cnt += 1
EndFunc   ;==>handle_SetCur_0_btn

Func setIT($cursorID, $override)
    Local $str

    GUISetCursor($cursorID, $override, $hMainWin)

    $str = "Set " & (($cursorID = 2) ? " normal" : " busy") & " cursor."
    $str &= " (override = " & $override & ")"
    ConsoleWrite("+++: " & $str & @CRLF)
    GUICtrlSetData($statusID, $str)

EndFunc   ;==>setIT

 

Link to comment
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
 Share

×
×
  • Create New...