内嵌IE不弹出新窗口
本帖最后由 xuerilangzi 于 2014-10-8 17:05 编辑#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ie.au3>
$oIE = ObjCreate("Shell.Explorer.1")
#Region ### START Koda GUI section ### Form=
$GUIMain = GUICreate("GUIMain", 800, 600, 0, 0)
GUICtrlCreateObj($oIE, 0, -0, 800, 600)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$EventObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents")
$URL = "http://www.hao123.com/"
$oIE.Navigate( $URL )
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func IEEvent_NewWindow($ppDisp,$Cancel)
Local $o_Shell = ObjCreate("Shell.Application")
Local $o_ShellWindows = $o_Shell.Windows(); collection of all ShellWindows (IE and File Explorer)
For $i = $o_ShellWindows.Count-1 To 0 Step -1
If $o_ShellWindows.item($i).LocationURL==$ppDisp Then
$o_ShellWindows.item($i).quit()
EndIf
Next
$oIE.Navigate( $ppDisp )
EndFunc
学习了,如果支持NewWindow2就更简单了 感谢楼主解决了我内嵌IE的一个问题!! 此贴很棒,经典~ 没用啊 还是弹出新窗口了啊 点击里面的链接
页:
[1]