Jump to content

Recommended Posts

Posted

I want to detect a click that is given to a button to some page with Internet Explorer and that after it detects me, I can take some action, it could be for example that it shows me an MsgBox I have been searching for a time but can't find anything to help me, Look that with the ObjEvent function but I do not know it very well, so I do not know if someone knew to help me in any way I thank you.


This is the code to validate


For example I would like to be clicked on the Forum Button

 

 

 

 

#include <IE.au3>
#include <MsgBoxConstants.au3>

Local $oIE = _IECreate("https://www.autoitscript.com/site/")
_IELoadWait($oIE)
$hwnd = _IEPropertyGet($oIE, "hwnd")
WinSetState($hwnd,"",@SW_MAXIMIZE)
Sleep(2000)
Send("^{1}")
Sleep(2000)


$HandleVentana = WinGetHandle("[CLASS:IEFrame]")
Sleep(200)
$Codigo = _IEAttach($HandleVentana, "hwnd")
Sleep(200)


Local $oButtons = _IETagNameGetCollection($Codigo, "Span")

For $oButton In $oButtons

    Sleep(500)

    If $oButton.InnerText = 'Forum' Then
        _IEHeadInsertEventScript($Codigo,"Forum","onclick",MsgBox("","","Ok"))
    EndIf

Next

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
×
×
  • Create New...