我想要的是创建IE嵌入式版本和打开mysite.com和打开随机链接。
#include <IE.au3>
#include <GUIConstantsEx.au3>
$width = 800
$height = 600
$hMain=GUICreate("TEST",800,600,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2)
$oIE = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj ($oIE, 0, 0, $width+3, $height+2)
$oIE.navigate("www.mysite.com")
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
$oIE._IELinkClickByIndex($oIE, Random(0, $iNumLinks -1))
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WinSetTitle($hMain,"",_IEPropertyGet($oIE, "title"))
WEnd
这是代码,米洛斯给我从一个网站获得所有链接,并打开随机链接。当我在IE上工作时,它工作得很好,但在IE嵌入式版本中,它不…(
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
_IELinkClickByIndex($oIE, Random(0, $iNumLinks))
所以需要帮助,使其工作在IE嵌入版本太
好了,搞定了。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister()
$width = 800
$height = 600
Local $oIE = _IECreateEmbedded()
$hMain=GUICreate("TEST",800,600,@DesktopWidth/2-$width/2,@DesktopHeight/2-$height/2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 0, 0, $width+3, $height+20)
GUISetState() ;Show GUI
_IENavigate($oIE, "www.mysite.com")
Local $oLinks = _IELinkGetCollection($oIE)
Local $iNumLinks = @extended
_IELinkClickByIndex($oIE, Random(0, $iNumLinks -1))
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WinSetTitle($hMain,"",_IEPropertyGet($oIE, "title"))
WEnd