Anzeige die das Script nicht stoppt

  • Hallo,

    ich wollte eine option ins script einbauen, die anzeigt, dass das script gerade arbeitet. am liebsten wäre mir ein prozessbalken, der die ganze zeit durchs bild huscht (keine prozentuale anzeige) ... aber solange, bist alle aktionen beendet sind.

    wenn ich aber den prozessbalken starte, bleibt der rest des scriptes hängen ...

    gibt es eine möglichkeit den so zu bauen, dass das script weiterläuft?

    das gleiche prob besteht auch bei splashtexton ... nach meiner erfahrung zZ kann ich im mom nur einen tooltip verwenden während das script weiterläuft.

  • Mir würde da jetzt spontan AdlibEnable() einfallen.
    Damit legst du einfach eine Funktion fest welche z.b. aller 100ms die Anzeige des Prozessbalkens aktualisieren soll.
    Da AutoIt aber nicht mehrere Threads unterstützt gibt es ein paar Funktionen die auch die Adlib-Funktion-Ausführung verhindert - einfach mal testen.

    • Offizieller Beitrag

    Hallo!

    Wie wäre es mit marquee? So ungefair:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    Global Const $PBS_MARQUEE = 0x08

    [/autoit] [autoit][/autoit] [autoit]

    $main = GUICreate("test", 464, 56, 193, 115)
    GUISetOnEvent($GUI_EVENT_CLOSE,"GUI_CLOSE")
    $Progress = GUICtrlCreateProgress(8, 8, 446, 17)
    GUICtrlSetStyle(-1,$PBS_MARQUEE)
    $statLabel = GUICtrlCreateLabel("Status: ", 8, 32, 446, 17)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlProgressSetMarquee($Progress)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData($statLabel,"Status: TrayTip 1 wird angezeigt!")
    TrayTip("test","123",1)
    Sleep(2000)
    TrayTip("","",1)
    GUICtrlSetData($statLabel,"Status: TrayTip 1 wurde angezeigt!")
    Sleep(700)
    GUICtrlSetData($statLabel,"Status: Fertig!")
    _GUICtrlProgressSetMarquee($Progress,0)
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func GUI_CLOSE()
    Exit
    EndFunc ;==>GUI_CLOSE

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;===============================================================================
    ;
    ; Function Name: _GUICtrlProgressSetMarquee()
    ; Description: Sets marquee sytle for a progress control
    ; Parameter(s): $h_Progress - The control identifier (controlID)
    ; $f_Mode - Optional: Indicates whether to turn the marquee mode on or off
    ; 0 = turn marquee mode off
    ; 1 = (Default) turn marquee mode on
    ; $i_Time - Optional: Time in milliseconds between marquee animation updates
    ; Default is 100 milliseconds
    ; Requirement(s): AutoIt3 Beta and Windows XP or later
    ; Return Value(s): On Success - Returns whether marquee mode is set
    ; On Failure - Returns 0 and sets @ERROR = 1
    ; Author(s): Bob Anthony
    ;
    ;===============================================================================
    ;
    Func _GUICtrlProgressSetMarquee($h_Progress, $f_Mode = 1, $i_Time = 100)

    [/autoit] [autoit][/autoit] [autoit]

    Local Const $WM_USER = 0x0400
    Local Const $PBM_SETMARQUEE = ($WM_USER + 10)

    [/autoit] [autoit][/autoit] [autoit]

    Local $var = GUICtrlSendMsg($h_Progress, $PBM_SETMARQUEE, $f_Mode, Number($i_Time))
    If $var = 0 Then
    SetError(1)
    Return 0
    Else
    SetError(0)
    Return $var
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc ;==>_GUICtrlProgressSetMarquee

    [/autoit]

    Mfg Spider

  • hey,

    dazu noch eine frage.
    ich starte verschiedene programme, die frei ausgewählt werden können.
    nachdem alle programme gestartet wurden, lasse ich ein splashtexton anzeigen, dass das tool fertig ist. jedoch kommt das splash, nachdem die programme gestartet wurden, d.h. ja aber noch nicht, dass dieser auch aktiv und bereit sind.

    kann man einbauen, dass er warten soll, bis alle fenster aktiv sind, bevor das splash angezeigt wird?

    [autoit][/autoit][autoit][/autoit][autoit]

    If $notify = "2" Then
    SplashTextOn("", $script & " is ready now", 250, 30, -1, -1, 0 + 1 + 32, "", "", 1000)
    Sleep(8000)
    SplashOff()
    ElseIf $notify = "1" Then
    GUIDelete($ProgressGui)
    Else
    EndIf

    [/autoit]
  • naja tüdelt hat noch eine WinExists-Abfrage rein bzw Do Until also solange warten bis alle Fenster da sind