oMBRa Posted June 16, 2009 Posted June 16, 2009 I managed to handle the event, but I dont get how to get the object that has fired the event,here is my script:#include <IE.au3> HotKeySet('{ESC}', 'Close') $oIE = _IECreate('http://www.autoitscript.com/') $oDocument = _IEDocGetObj($oIE) ObjEvent($oDocument, 'IEFunc_', 'HTMLDocumentEvents') If @error Then MsgBox(0, '', 'ObjEvent error') Exit EndIf While 1 Sleep(10) WEnd Func IEFunc_onmouseover() MsgBox(0, '', '') EndFunc ;==>IEFunc_onmouseover Func Close() Exit EndFunc ;==>Closehere are the informationshttp://msdn.microsoft.com/en-us/library/aa743131(VS.85).aspxif u scroll down the page there is "IHTMLEventObj::fromElement", that is the property I need, any help?
junkew Posted June 16, 2009 Posted June 16, 2009 I think you have to trap for each object but if your approach works than @COM_EventObj will help you further For $oTag in $oTags $oEvents[$i] = ObjEvent($oTag, "IE_Evt_") $tStyle = $oTag.style.border consolewrite("tstyle:" & $tStyle & @LF) $i += 1 ReDim $oEvents[$i + 1] Next Func IE_Evt_onmouseover() $o = @COM_EventObj ConsoleWrite($o.tagname & " : " & $o.id & $o.innerhtml & $o.type & @LF) endfunc FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
oMBRa Posted June 22, 2009 Author Posted June 22, 2009 I think you have to trap for each object but if your approach works than @COM_EventObj will help you further For $oTag in $oTags $oEvents[$i] = ObjEvent($oTag, "IE_Evt_") $tStyle = $oTag.style.border consolewrite("tstyle:" & $tStyle & @LF) $i += 1 ReDim $oEvents[$i + 1] Next Func IE_Evt_onmouseover() $o = @COM_EventObj ConsoleWrite($o.tagname & " : " & $o.id & $o.innerhtml & $o.type & @LF) endfuncit returns only "html"
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