回复 1# guland
请使用该段代码!!#include <GUIConstants.au3>
#include <WindowsConstants.au3>
$oIE = ObjCreate("Shell.Explorer.2"); open the com openject
$oEvt = ObjEvent($oIE,"IEEvent_","DWebBrowserEvents"); attach the DWebBrowserEvents where 'BeforeNavigate' is part of
GUICreate(@ScriptName, 800, 600, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GUICtrlCreateObj($oIE, 0, 0, 800, 600); make the com object visible
GUISetState()
With $oIE; make a object pool
.RegisterAsBrowser = True
.RegisterAsDropTarget = True
.TheaterMode = True
.Resizable = False
.navigate("http://www.baidu.com")
EndWith
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
Exits()
Func IEEvent_BeforeNavigate($url,$Flags,$TargetFrameName,$PostData,$Headers,$Cancel)
_say('before Navigate Event notified')
_say($url)
_say($Flags)
_say($TargetFrameName)
_say($PostData)
_say($Headers)
_say($Cancel)
EndFunc
Func IEEvent_NewWindow($url,$Flags,$TargetFrameName,$PostData,$Headers,$Cancel)
MsgBox(0,"----------guland--------------","点击确定谢谢我吧~~~")
_say('Newwindows')
_say($url)
_say($Flags)
_say($TargetFrameName)
_say($PostData)
_say($Headers)
_say($Cancel)
EndFunc
Func Exits()
GUIDelete()
$oEvt = 0
$oIE = 0
Exit
EndFunc
Func _Say($tx)
ConsoleWrite($tx & @CR)
EndFunc
|