好吧。给你个代码测试下。 牵扯到的文件在这里
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button = GUICtrlCreateButton("搜索AUTOIT论坛", 100, 420, 100, 30)
GUISetState()
_IENavigate ($oIE, "http://www.baidu.com")
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button
js(FileRead("jquery-1.6.1.min.js"))
js("$('#kw').val('www.Autoitx.com')")
js("$('#su').click()")
Sleep(1000)
_IELinkClickByText($oIE,"AUTOIT CN AutoIt中文论坛|acn|au3|软件汉化 - 分享您的技术!")
EndSelect
WEnd
Func js($script)
$oIE.document.parentWindow.execscript($script)
EndFunc
|