Hi,
ich habe folgendes Script:
Spoiler anzeigen
#include <ts3.au3>
#include <GUIConstantsEx.au3>
#include <GuiButton.au3>
#region ### START Koda GUI section ### Form=
$loginform = GUICreate("Login", 272, 149, 192, 124)
$serverinput = GUICtrlCreateInput("", 80, 8, 177, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$serverlable = GUICtrlCreateLabel("Server:", 8, 8, 54, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$userinput = GUICtrlCreateInput("", 80, 43, 177, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$userlable = GUICtrlCreateLabel("User:", 8, 43, 41, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$passwortinput = GUICtrlCreateInput("", 82, 77, 177, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$passwortlable = GUICtrlCreateLabel("Passwort:", 10, 77, 73, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Arial")
$loginbutton = GUICtrlCreateButton("Login", 80, 112, 75, 25)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $loginbutton
_TS3connect(GUICtrlRead($serverinput))
$wert = _TS3login(GUICtrlRead($userinput), GUICtrlRead($passwortinput))
If $wert > 1 Then
_GUICtrlButton_Enable($loginbutton, False)
For $i = $wert To 0 Step -1
GUICtrlSetData($loginbutton, "Ban: " & $i)
Sleep(1000)
Next
GUICtrlSetData($loginbutton, "Login")
_GUICtrlButton_Enable($loginbutton, True)
EndIf
EndSwitch
WEnd
Die ts3.au3 ist in meiner Sig, ist aber für mein Problem nicht nötig. Wie man sieht wird nach einem klick auf den Loginbutton geprüft ob der Wert in $wert >1 ist. Wenn ja wird wird der Button deaktivier und eine forschleife ausgeführt bist $wert auf 0 ist. Soweit funktioniert das auch.
Mein Problem ist nun aber, dass während die For-Schleife läuft man die GUI nicht schließen kann, weil ja nicht auf $GUI_EVENT_CLOSE geprüft wird. Eine Umstellung auf onEvent brauchte genausowenig einen Erfolg wie auch der Einsatz von adlib.
Hat jemand eine Idee?