2011-05-20 45 views
0

這是一個簡單的問題,但找不到一個簡單的答案...
我在NSIS中編寫一個腳本,我需要打開兩個窗口Internet Explorer的

於是我就用......
UAC :: Exec的 ''「 「$ PROGRAMFILES \的Internet Explorer \ IEXPLORE.EXE」,「$ URL_1' '' ''
然後...
UAC :: Exec'''「$ PROGRAMFILES \ Internet Explorer \ iexplore.exe」「$ url_2'''''


但是我想要打開$ url_2 BEHIND /在後臺打開$ url_1
我瘋了......謝謝你的幫助!

ps。只要它啓動一個新的IE窗口,我不會被迫使用UAC :: Exec。如何使用NSIS在後臺打開第二個Internet Explorer窗口

回答

1

答案很簡單:只需切換打開的窗口的順序:

UAC::Exec '' '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$url_2' '' '' 
then... 
UAC::Exec '' '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "$url_1' '' '' 

所以$ url_2將在後面$ URL_1,因爲它是後來開了......

編輯

如果你希望在前面有一個確切的窗口,你必須知道它的名字(在完全加載後IE設置名稱爲窗口)。

使用這個簡單的循環將正確的窗口放在前面。 (我用Exec的,但正常工作與UAC和nsExec)

; This Window is opened as first 
Exec '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "www.google.sk"' # $url_1 
; This is opened later 
Exec '"$PROGRAMFILES\Internet Explorer\iexplore.exe" "www.unsigned-softworks.sk/installer"' # $url_2 

CheckWindow: 
    Sleep 500 ; Wait some time (miliseconds) 

    ; Find by Window class and by Window name 
    FindWindow $1 "IEFrame" "Google - Windows Internet Explorer" 
    # This name must be known in compile time!!! 
    # Get this name by running $url_1 in IE 

    ; If window is not found (not loaded!) search again 
    IntCmp $1 0 CheckWindow Continue Continue 

Continue: 
    # If found (opened & loaded), bring $url_1 to front 
    System::Call "User32::SetForegroundWindow(i) b ($1)" 
+0

也許我還不夠清楚,但要求「$ URL_1」之前「$ url_2」打開。 – developerGuile 2011-05-24 13:58:11

相關問題