测试使用timer消息是有效果的
#include <IE.au3>
#include <Timers.au3>
$oIE = _IECreateEmbedded()
$gui = GUICreate("测试",600,600)
GUICtrlCreateObj($oIE,0,0,600,600)
GUISetState()
_IENavigate($oIE,@ScriptDir&"\test.html")
$iid = _Timer_SetTimer(0,250,"click")
_IELinkClickByText($oIE,"百度")
Do
Until GUIGetMsg()=-3
Func click($hwnd,$msg,$wPlate,$lPlate)
$handle = WinWait("[class:#32770]")
ControlClick($handle,"","Button1")
_Timer_KillTimer(0,$iid)
EndFunc
test.html<html>
<body>
<a href="http://www.baidu.com" onclick=alert("ok")>百度</a>
</body>
</html>
|