I found the tutorial from tank, and it shows the script opening the window.
In my case the window will be opened by the startup.exe already on the computer.
Code: Select all
;Hide the ahk tray icon.
#notrayicon
;The below command needed to ControlSend to hidden windows.
;SetTitleMatchMode, 2
DetectHiddenWindows, On
;make sure the computer is connected before trying to login.
ConnectedToInternet(flag=0x40) {
Return DllCall("Wininet.dll\InternetGetConnectedState", "Str", flag,"Int",0)
}
While ConnectedToInternet()<>1
{
sleep, 1000
}
;open inb link hidden
;this command opens ie window visible to the user
;find a way to make the window stay hidden while logging in.
;Run, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
Run, D:\navisys\fo\run\startup.exe -ini startup.ini -url http://localhost:30213/en/Login.jsp, D:\navisys\fo\run, Hide
;Make sure ie never displays and wait for login page to load. Replace with winwait.
WinWait, xxx - Log in ahk_class IEFrame
;WinHide, xxx - Log in ahk_class IEFrame
;enter the username and password and click login. Replace with controlsend
;WinGet, WinID, ID, ahk_class IEFrame
;ControlSend,ahk_parent, b,ahk_id %WinID%
;return
SendInput, SYNC{TAB}SYNC{TAB}{ENTER}
WinHide, xxx - Log in ahk_class IEFrame