Jump to content

Show mouse "busy" cursor


Recommended Posts

Hello. I would like to show mouse "busy" cursor (pointer with sand clock on XP/pointer with a circle on Vista/7) until a window shows up. And I am not using a custom GUI. All I want is to let the user know that my script is doing its work. I don't want to use "Please Wait" splash screens or tray notifications. A "busy" cursor will do.

I know I can change it for GUI window, but I want to do it system-wide. Any way?

Thanks in advance.

Edited by supraspecies
Link to comment
Share on other sites

Please have a look at function GUISetCursor.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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_arrow.cur", $OCR_NORMAL) ; Uncomment to reset
_SetCursor(@WindowsDir & "\cursors\aero_busy.ani", $OCR_NORMAL)

Func _SetCursor($sCursorFile, $iCursor)
    Local $hCursor, $bResult
    $hCursor = DllCall("user32.dll", "int", "LoadCursorFromFile", "str", $sCursorFile)
    If Not @error Then
        $bResult = DllCall("user32.dll", "int", "SetSystemCursor", "int", $hCursor[0], "int", $iCursor)
        If Not @error Then
            $bResult = DllCall("user32.dll", "int", "DestroyCursor", "int", $hCursor[0])
        Else
            SetError(1, 0, 0)
        EndIf
    Else
        SetError(1, 1, 0)
    EndIf
EndFunc  ;==>_SetCursor

Link to comment
Share on other sites

  • 4 years later...

The function works well except that the "busy" cursor does not spin. How do I make it spin and not be a static circle? If  change the cursor to the hour glass then it should turn upside down and back etc. But it does not.

Bottom line is how do you animate the cursor once you change it?

Thanks for the help,

Ralph

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...