Synapsee

cursor loading flick problem ($OCR_APPSTARTING)

3 posts in this topic

#1 ·  Posted (edited)

Hi, on a script i use something like that on a W7X64 machine :

#NoTrayIcon

If $CMDLINE[0] > 0 Then
    ;Any code
    Exit
EndIf

TraySetIcon()

;Reproduce "cursor loading flick problem" (make your cursor on desktop for sample)
$command1 = "something"
while 1
    sleep(500)
    Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" ' & $COMMAND1, @ScriptDir, @SW_HIDE)
Wend

 

That works but this produce a "cursor loading flick problem", the ask is how can i fix that ?

Related post : https://www.autoitscript.com/forum/topic/136704-is-it-possible-run-a-function-with-autoit3executeline/?do=findComment&comment=955591

Edited by Synapsee

Share this post


Link to post
Share on other sites



use a longer sleep time

Share this post


Link to post
Share on other sites
3 hours ago, AutoBert said:

use a longer sleep time

this not really help... ^^
i want disable the cursor loading, not increase the time between

i have discover "cursor loading" = $OCR_APPSTARTING

i have maybe found a path :

;Include
#include <WinAPIRes.au3>


;commented for current test only
;#NoTrayIcon


If $CMDLINE[0] > 0 Then
    ;Any code
    Sleep(5000)
    Exit
EndIf


;commented for current test only
;TraySetIcon()


;CopyCursor
Local $h_NORMAL = _WinAPI_CopyCursor(_WinAPI_LoadCursor(0, $OCR_NORMAL))
Local $h_APPSTARTING = _WinAPI_CopyCursor(_WinAPI_LoadCursor(0, $OCR_APPSTARTING))


;now you will see multi trayicon but no more $OCR_APPSTARTING flick :D
$command1 = "something"
$i = 0
while $i < 20

    $i = $i + 1;for exit after 20 ticks

    sleep(500-200)

    ;Run AutoIt without fire $OCR_APPSTARTING
        _WinAPI_SetSystemCursor($h_NORMAL, $OCR_APPSTARTING, True);replace $OCR_APPSTARTING with $OCR_NORMAL

        ;Run AutoIt, this fire $OCR_APPSTARTING so now this fire for no change
        Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" ' & $COMMAND1, @ScriptDir, @SW_HIDE)

        ;I place a part of the sleep here because we need wait $OCR_APPSTARTING AutoIt Operation
        sleep(200)

        ;Reset $OCR_APPSTARTING to normal value
        _WinAPI_SetSystemCursor($h_APPSTARTING, $OCR_APPSTARTING, True)

Wend


;Clear CopyCursor ressource
_WinAPI_DestroyCursor($h_NORMAL)
_WinAPI_DestroyCursor($h_APPSTARTING)

 

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