Jump to content

IE - Detection of mouseclick


Recommended Posts

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

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 by About_Nothing
Link to comment
Share on other sites

#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! :blink:

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...