So erst mal ein paar Erklärungen:
Runtergeklappt meine ich Nicht aktiv und unten in der Zeile.
Ich hab mal mit Goto probiert. Das geht im ertsenschritt nicht weil er ja keine Fokus hat weil das Programm natürlich dabei nicht gestartet wird.
Wenn ich dei Variable "Titel" befülle kann man sehen, das die Schritte ausgeführt werden aber man sieht das das Fenster nicht aktiv is da die Menu Punkte nicht blau sind sondern leicht hellgrau.
Den Effekt das die "Underlines" kommen ensteht auch nicht weil das Fenster nicht aktiv ist.
Gibt es einen Befehl "Fenster Fokus zuteilen" oder so ?
Gesamt Code mit Experimenten und Kommentaren:
Code: Select all
;Goto, weiter
run C:\ELS_V55R6_DE\ELS5.exe
WinWaitActive, ahk_class WindowsForms10.Window.8.app.0.378734a ; ahk_class des Login Fensters
Sleep 8000
ControlSend, WindowsForms10.EDIT.app.0.378734a1 ,4711, ahk_class WindowsForms10.Window.8.app.0.378734a ; das tut es
Sleep 1000
ControlClick, &Login, ahk_class WindowsForms10.Window.8.app.0.378734a
Sleep 4000
WinGetActiveTitle, Titel
;MsgBox, Das aktive Fenster ist "%Titel%"
weiter:
;EnvSet, Titel, ELS5 - ODBC - AKZO [DOM] ; Versuch mit Titel setzen bei GOTO was auch geht
;MsgBox, Das aktive Fenster ist "%Titel%"
Sleep 2000
ControlSend, ,{Down}, %Titel%
;ControlSend, ,{Down}, ELS5 - ODBC - AKZO [DOM] ; Versuch mit Titel direkt bei GOTO
;ControlSend, ,{Down} , ahk_class WindowsForms10.Window.8.app.0.378734a ; Versuch mit ahk_class direkt bei GOTO
Sleep 2000
ControlSend, ,{Down}, %Titel%
;ControlSend, ,{Down}, ELS5 - ODBC - AKZO [DOM] ;Versuch mit Titel direkt bei GOTO
;ControlSend, ,{Down} , ahk_class WindowsForms10.Window.8.app.0.378734a ; Versuch mit ahk_class direkt bei GOTO
Sleep 2000
;WinGetActiveTitle, Titel ; Mal gucken ob er den Fokus hat bei Goto
;MsgBox, Das aktive Fenster ist "%Titel%" ;Mal gucken ob er den Fokus hat bei Goto
ControlSend, ,{Down}, %Titel%
Sleep 2000
ControlSend, , !L, %Titel%
Sleep 1000
ControlSend, ,!S, %Titel%
Sleep 1000
MsgBox, Das aktive Fenster ist "%Titel%"