回复 1# hlzxcjx
#include <IE.au3>
$Form1 = GUICreate("最简内嵌浏览器", 1024, 600)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 0, 0, 1024, 600)
_IENavigate($oIE, "http://www.baidu.com")
_IELoadWait($oIE)
GUISetState(@SW_SHOWNORMAL)
; 通过Id获取关键词文本域对象
Local $oGuanJianCi = _IEGetObjById($oIE, "kw")
If IsObj($oGuanJianCi) Then
; 在关键词文本域中输入内容
$oGuanJianCi.value = "在Sublime Text 3中搭建AutoIt3环境"
Else
MsgBox(0, "蟒加加", "获取关键词文本域对象失败!")
EndIf
; 通过Id获取确定按钮对象
Local $oBaiDuYiXia = _IEGetObjById($oIE, "su")
If IsObj($oBaiDuYiXia) Then
; 单击“百度一下”按钮
$oBaiDuYiXia.click()
Else
MsgBox(0, "蟒加加", "获取确定按钮对象失败!")
EndIf
MsgBox(0, "蟒加加", "脚本执行完毕!")
While 1
Sleep(1)
If GUIGetMsg() = -3 Then Exit
WEnd
|