Sign in to follow this  
Followers 0
supraspecies

Show mouse "busy" cursor

5 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Please have a look at function GUISetCursor.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I did... Not sure how do I go around that without having GUI.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#5 ·  Posted

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

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  
Followers 0