AndyS01

Busy cursor not shown when hovering over control items

3 posts in this topic

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

 

Share this post


Link to post
Share on other sites



Yup, 3.3.10.2

I'll try to find a download for a newer version.

 

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

  • Similar Content

    • StMaSi
      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?
      Thanx.
    • algiuxas
      By algiuxas
      Hello,
      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)
    • xiantez
      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!!

    • knucklesCZ
      By knucklesCZ
      Hello to all autoit coders, I'm not a pro dev but I've recently made a few automatisation programs. I met a program SplashTop which allows user to control their PC from android phone and play games through it (e.g. Skyrim or any other game with first person camera). The program is perfect but it's totally missing one thing - mouse move. It only allows mouse click&drag as user moves their finger on the touch screen.I was thinking about using physical phone keyboard <>^(and down) to mouse move but not many ppl have got qwerty phones such motorola droid 4 or similar and I can transfer <>^ into mousemove. The question is if any of you know a way to disable mouse click&drag and convert it into  mousemove. Thanks for responses, I'm sorry but I can't make paragraphs on mobile version
       
       
    • MAS
      By MAS
      Hello
      I'm trying to set a new cursor instead of the default cursors of the system
      ex: make the default arrow cursor is busy until a program starts
      I've searched the forum and got this code
      Global Const $OCR_APPSTARTING = 32650 Global Const $OCR_NORMAL = 32512 Global Const $OCR_CROSS = 32515 Global Const $OCR_HAND = 32649 Global Const $OCR_IBEAM = 32513 Global Const $OCR_NO = 32648 Global Const $OCR_SIZEALL = 32646 Global Const $OCR_SIZENESW = 32643 Global Const $OCR_SIZENS = 32645 Global Const $OCR_SIZENWSE = 32642 Global Const $OCR_SIZEWE = 32644 Global Const $OCR_UP = 32516 Global Const $OCR_WAIT = 32514 _SetCursor(@WindowsDir&"\cursors\aero_working.ani", $OCR_NORMAL) Func _SetCursor($s_file, $i_cursor) Local $newhcurs $newhcurs = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $s_file) DllCall("user32.dll", "int", "SetSystemCursor", "int", $newhcurs[0], "int", $i_cursor) DllCall("user32.dll", "int", "DestroyCursor", "int", $newhcurs[0]) EndFunc  
      this code is good in changing the cursor from an external file
      but can I change the cursor without using external files ( as in win XP there're no files for default cursors)
      ex: change default system Normal arrow to AppStarting arrow directly
       
      Thank you and Any help is very appreciated,