About_Nothing Posted July 29, 2010 Share Posted July 29, 2010 Hi, I started experimenting with IE UDF and I discovered many helpful functions there, however I was unable to find a way to detect mouse click on object in website (e.g button). Have you got any idea how to achieve this? Regards, -- AN Link to comment Share on other sites More sharing options...
DaleHohm Posted July 29, 2010 Share Posted July 29, 2010 See ObjEvent Note that AutoIt can only be thought of as being "notified" of events... it cannot pause or stop and event (it will likely find out about events AFTER they have already been processed by the DOM). You may also want to look at _IEHeadInsertEventScript() to inset an event processor in the document. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
About_Nothing Posted July 29, 2010 Author Share Posted July 29, 2010 (edited) Thanks for reply, I just wanted to read the events, not to control them. I tried ObjEvent, but I still can not find out how to "filter" a specific event. e.g: #include <IE.au3> $oIE = _IEAttach ("Google", "WindowTitle") $oForm = _IEGetObjByName ($oIE, "btnG") $evt = ObjEvent ( $oForm, "test") while 1 sleep(50) WEnd func test() msgbox(0,"info","you have clicked the button") EndFunc This script shows the messagebox when an event on "button" is detected, but I can not figure out how to show the message when the button is clicked. I was trying some things, but still no success. Edited July 29, 2010 by About_Nothing Link to comment Share on other sites More sharing options...
About_Nothing Posted July 29, 2010 Author Share Posted July 29, 2010 #include <IE.au3> $oIE = _IECreate("http://www.google.com") $oForm = _IEGetObjByName ($oIE, "btnG") _IEHeadInsertEventScript($oIE, $oForm, "onclick", "return false;") ObjEvent($oForm, "_Evt_") While 1 Sleep(100) WEnd Func _Evt_onclick() Local $oForm = @COM_EventObj ;ConsoleWrite($oForm.href & @CR) MsgBox(0,"info","The button " & $oForm.value & " was clicked") EndFunc I got it, thanks for help again! Link to comment Share on other sites More sharing options...
DaleHohm Posted July 29, 2010 Share Posted July 29, 2010 For testing you can also Func Test($evt) ConsoleWrite($evt & @CRLF) EndFunc Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now