這是一個簡單的問題,但找不到一個簡單的答案...
我在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窗口
0
A
回答
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)"
1
最好的選擇是讓你用C++編寫自己的插件,並使用CreateProcess()和SetForgroundWindow()的組合。
相關問題
- 1. 如何在pygtk中打開第二個窗口後關閉第一個窗口
- 2. VBA/Internet Explorer/Javascript:如何從同一個Internet Explorer打開一個JavaScript窗口?
- 3. 如何使用c#連接到Internet Explorer的打開窗口?
- 4. 如何從另一個(父母)打開fancybox窗口,打開第二個窗口後如何保留父窗口?
- 5. 在PyQt中打開第二個窗口
- 6. 在後臺打開窗口
- 7. 使用Tkinter iwant打開第二個窗口,然後關閉前一個窗口
- 8. 如何在Internet Explorer的新窗口中打開網址
- 9. 如何防止在託管Internet Explorer中打開新窗口
- 10. 在一個Internet Explorer窗口中打開多個選項卡
- 11. 從IE(Internet Explorer)中的非HTML5窗口打開HTML5窗口
- 12. 從IBAction打開第二個窗口
- 13. japplet打開第二個窗口
- 14. Qt打開第二個窗口
- 15. 如何從wpf的第一個窗口打開第二個窗口?
- 16. 如何從pyqt的第一個窗口打開第二個窗口?
- 17. 使用Chrome打開Internet Explorer/Firefox等窗口
- 18. 在Internet Explorer 8中使用Javascript在新會話中打開一個新窗口
- 19. 在Python 3中使用QTDesigner 5打開第二個窗口
- 20. 如何使用javascript在後臺打開彈出窗口?
- 21. 如何打開第二個窗體?
- 22. ASP.Net:如何打開第二個窗口並在主窗口中寫入內容?
- 23. 如何在y關閉第一個窗口後打開一個新窗口?
- 24. Facebook FriendsList窗口無法在Internet Explorer 8中打開
- 25. 從已打開的對話窗口打開第二個對話窗口
- 26. window.showModalDialog打開第二個窗口,如何阻止它?
- 27. 使用SFML在第二臺顯示器上打開全屏窗口?
- 28. NSIS安裝程序在後臺打開
- 29. NSIS安裝程序在後臺打開。
- 30. jQuery Mobile的導致Internet Explorer窗口發送到後臺負載
也許我還不夠清楚,但要求「$ URL_1」之前「$ url_2」打開。 – developerGuile 2011-05-24 13:58:11