Ich verarbeite doch die Msg in der Schleife oder sehe ich das falsch ?
AutoIt
While true
global $nMsg = GUIGetMsg()
If $nMsg = $Button1 Then Fensterwechsel()
If $nMsg = $GUI_EVENT_CLOSE Then Exit
If $nMsg = $Button2 Then Exit
WEnd
Fensterwechsel()
Func Fensterwechsel()
For $i=0 To 1
Run("C:\Program Files (x86)\Radmin Viewer 3\Radmin.exe")
sleep(2000)
WinWaitActive("[CLASS:RadminViewerMainWndBASECLASS#185708]")
Send("{f10}")
Send("{enter 2}")
Send("{tab 9}")
Send("{DOWN}")
Send("{tab}")
send($pcname[$i],"{1}")
Send("{enter}")
Next
while $Stopp = true
$nMsg = GUIGetMsg()
If $nMsg = $GUI_EVENT_CLOSE Then Exit
If $nMsg = $Button2 Then Return
Global $hWnd = WinWait($pcname[0] &" - View Only", "", 5)
Sleep($dauerfensterwechsel)
WinActivate($hWnd)
If WinActive($hWnd) Then
WinSetState($hWnd, "", @SW_MAXIMIZE)
Else
WinSetState($hWnd, "", @SW_HIDE)
EndIf
Alles anzeigen
Ich hab jetzt einen neuen Ansatz verfolgt jedoch noch ohne Erfolg.
Wo liegt denn mein Fehler ?
WinExists gibt ja eine 0 zurück wenn ein Fenster geschlossen wird.
Ich hab eine Globale Variabel $ Stopp = true gesetzt. Die Schleife läuft jetzt solange $stopp = true ist.
Jedoch funktioniert das nicht so richtig. Wo habe ich denn den Denkfehler ?