2016-09-07 70 views
1

我真的很陌生(像很新的),但我設法用AutoIt做我想做的事情。這意味着:在Kiosk模式下的某個網頁上自動啓動IE。到現在爲止還挺好。AutoIt在Kiosk模式下在IE中發送命令

但之前我不是在kiosk模式輸入發送工作,但現在我找不到問題,爲什麼它不再工作。

ShellExecuteWait("c:\Program Files\Internet Explorer\iexplore.exe", "-k http://website.com", "") 

WinWaitActive("website.com  Login - Internet Explorer","") 

Send("login{TAB}password{ENTER}") 

該網站啓動,我直接在登錄框中,但沒有輸入任何內容。有任何想法嗎?

+2

因爲焦點可能不在登錄框上? – Steve

+0

確實是這樣! – Primseven

回答

1

像@Steve在評論中說的,你可以嘗試在顯示窗口時使用ControlFocus,然後發送憑證。

ShellExecuteWait("c:\Program Files\Internet Explorer\iexplore.exe", "-k http://website.com", "") 

; store the returned window handle to use it in the ControlFocus call 
Local $hWnd = WinWaitActive("website.com Login - Internet Explorer","") 

ControlFocus($hWnd, "", "Edit1") 

Send("login{TAB}password{ENTER}") 
+0

這確實是ControlFocus。我錯過了。因爲在Kiosk模式下設置IE之前並不需要它。謝謝你的時間。我還在學習。 – Primseven

+0

不客氣,@Primseven! :) – mrt