本帖最后由 lixiaolong 于 2012-2-21 01:33 编辑
回复 1# 自然
试试这个.#include<ie.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate(" test ", 850, 520, -1, -1)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 850, 520)
_IENavigate_2($oIE, "http://www.sina.com.cn/", 1, 15000) ;1000 = 1秒
If @error = 6 Then _IENavigate_2($oIE, "http://www.163.com/", 1, 15000)
If @error = 6 Then _IENavigate_2($oIE, "http://www.hao123.com/", 1, 15000)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _IENavigate_2(ByRef $o_object, $s_Url, $f_wait = 1, $Time_out = 300000)
If Not IsObj($o_object) Then
__IEErrorNotify("Error", "_IENavigate", "$_IEStatus_InvalidDataType")
Return SetError($_IEStatus_InvalidDataType, 1, 0)
EndIf
;
If Not __IEIsObjType($o_object, "documentContainer") Then
__IEErrorNotify("Error", "_IENavigate", "$_IEStatus_InvalidObjectType")
Return SetError($_IEStatus_InvalidObjectType, 1, 0)
EndIf
;
$o_object.navigate($s_Url)
If $f_wait Then
_IELoadWait($o_object, 0, $Time_out)
Return SetError(@error, 0, -1)
EndIf
Return SetError($_IEStatus_Success, 0, -1)
EndFunc ;==>_IENavigate_2
|