如题..还有点击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 编辑 ] |