Jump to content
Sign in to follow this  

Busy cursor not shown when hovering over control items

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_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6

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

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

Global $hMainWin, $statusID, $cnt = 0


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()
            Case $msg = $GUI_EVENT_CLOSE

EndFunc   ;==>_Main

Func Event_GUIClose()
EndFunc   ;==>Event_GUIClose

Func handle_SetCur_1_btn()

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

    $cnt += 1
EndFunc   ;==>handle_SetCur_1_btn

Func handle_SetCur_0_btn()
    If (Mod($cnt, 2)) Then
        setIT(15, 0)
        setIT(2, 0)
    $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


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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By badcoder123
      Hey, all.  
      I've been looking for a way to change cursor colour but not the cursor itself. I've been looking for a couple hours now and can't find anything.  I also don't even know where to start, if anyone has any tips or examples please comment them.
    • By AndreyS
      Tell me, please, how to set / change the cursor over RichEdit (created with _GUICtrlRichEdit_Create)?
    • By StMaSi
      Two questions...
      When presenting a form containing a richedit control, is there any way to make the displayed text, within said richedit control, non-selectable?
      In addition, is there any way to hide the vertical line cursor, within said richedit control?
    • By algiuxas
      I want that when mouse cursor is in GUI, cursor would hide, and when cursor is outside GUI it would appear again.

      (Sorry for my bad English)
    • By xiantez
      Hey Community,
      I was changing around my color scheme manually for syntax highlighting. I really enjoy using a dark background color. However, this seems to be problematic because my blinking cursor is also very dark. Is there a setting in the ScITE config where I can manipulate the blinking cursor to be a different color like "white" so it is easy to spot when coding. The closest thing I found was "Caret Line Color", but this just changes the line highlight.  Your help is greatly appreciated!!

  • Create New...