这是一个简单的问题,但找不到简单的答案......
我正在NSIS编写脚本,我需要在Internet Explorer中打开两个窗口
所以我用......
UAC :: Exec'''“$ PROGRAMFILES \ Internet Explorer \ iexplore.exe”“$ url_1'''''
然后...
UAC :: Exec'''“$ PROGRAMFILES \ Internet Explorer \ iexplore.exe”“$ url_2'''''
但我希望$ url_2在$ url_1的后台打开/后面打开
我在那里疯了......谢谢你的帮助!
PS。只要它启动一个新的IE窗口,我就不会被迫使用UAC :: Exec。
答案 0 :(得分:1)
最好的选择是用c ++编写自己的插件,并使用CreateProcess()和SetForgroundWindow()的组合。
答案 1 :(得分: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)"