Hallo Jans16,
du must den Fortschrittsbalken mit dem Stil $PBS_MARQUEE erzeuen. Hier noch ein kleines Skript dazu:
Spoiler anzeigen
#include <GUIConstants.au3>
Global Const $PBS_MARQUEE = 0x08
$main = GUICreate("test", 464, 56, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE,"GUI_CLOSE")
$Progress = GUICtrlCreateProgress(8, 8, 446, 17,$PBS_MARQUEE)
$statLabel = GUICtrlCreateLabel("Status: ", 8, 32, 446, 17)
GUISetState(@SW_SHOW)
_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
EndSwitch
WEnd
Func GUI_CLOSE()
Exit
EndFunc ;==>GUI_CLOSE
;===============================================================================
;
; 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)
Local Const $WM_USER = 0x0400
Local Const $PBM_SETMARQUEE = ($WM_USER + 10)
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
EndFunc ;==>_GUICtrlProgressSetMarquee
[/autoit]
und das Beispiel aus der Hilfe dabei den 2. auf endlos geändert
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]Example()
[/autoit] [autoit][/autoit] [autoit]Func Example()
Local $progressbar1, $progressbar2, $button, $wait, $s, $msg, $m
GUICreate("My GUI Progressbar", 220, 100, 100, 200)
$progressbar1 = GUICtrlCreateProgress(10, 10, 200, 20)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
$progressbar2 = GUICtrlCreateProgress(10, 40, 200, 20, $PBS_MARQUEE);;Zeile ist gegenüber Original geändert
$button = GUICtrlCreateButton("Start", 75, 70, 70, 20)
GUISetState()
$wait = 20; wait 20ms for next progressstep
$s = 0; progressbar-saveposition
Do
$msg = GUIGetMsg()
If $msg = $button Then
GUICtrlSetData($button, "Stop")
For $i = $s To 100
If GUICtrlRead($progressbar1) = 50 Then MsgBox(0, "Info", "The half is done...", 1)
$m = GUIGetMsg()
If $m = -3 Then ExitLoop
[/autoit] [autoit][/autoit] [autoit]If $m = $button Then
GUICtrlSetData($button, "Next")
$s = $i;save the current bar-position to $s
ExitLoop
Else
$s = 0
GUICtrlSetData($progressbar1, $i)
GUICtrlSetData($progressbar2, 1) ;Zeile ist nötig und gegenüber Original geändert
Sleep($wait)
EndIf
Next
If $i > 100 Then
; $s=0
GUICtrlSetData($button, "Start")
EndIf
EndIf
Until $msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example
mfg (Auto)Bert