找回密码
 加入
搜索
查看: 1756|回复: 3

[内嵌IE]如何实现当点击网面中某个链接时触发事件

[复制链接]
发表于 2009-1-11 12:29:50 | 显示全部楼层 |阅读模式
如题..还有点击JS时也触发事件
如何实现??

就是想要当点击程序内嵌IE里的网页某个按钮时..程序也会一个触发事件

已解决...
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
$Form1_1 = GUICreate("Form1", 688, 456, -1, -1, _
                $WS_OVERLAPPED + $WS_CAPTION + $WS_SYSMENU  + $WS_MINIMIZEBOX + $WS_MAXIMIZEBOX + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, -1, -1, 688, 456)
GUICtrlSetResizing($GUIActiveX, 1)
GUISetState()
_IENavigate ($oIE, "about:blank")
_IEBodyWriteHTML ($oIE, "<input type='button' name='b1' value='按钮1'> <br> <input type='button' name='b2' value='按钮2'>")

$oButton1 = _IEGetObjByName ($oIE, "b1")
$oButton2 = _IEGetObjByName ($oIE, "b2")

$oEvent1 = ObjEvent( $oButton1, "Button1_")
$oEvent2 = ObjEvent( $oButton2, "Button2_")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

GUIDelete()

Exit

Func Button1_onclick()
        MsgBox(0, "test", "你点击的是按钮1")
EndFunc

Func Button2_onclick()
        MsgBox(0, "test", "你点击的是按钮2")
EndFunc
[ 本帖最后由 阿米啦啦 于 2009-1-11 18:53 编辑 ]
发表于 2009-7-3 18:17:37 | 显示全部楼层
本帖最后由 tisiem 于 2009-7-3 21:13 编辑

帮顶,我正想知道。

晕,没看懂还,我是用IE打开一个网站,要去看用户点击了那个页面的哪个链接。
发表于 2009-8-5 21:34:10 | 显示全部楼层
这样做没有意义吧,调试可以用上上面的功能
发表于 2012-7-5 21:52:56 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 05:29 , Processed in 0.083244 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表