Sign in to follow this  
Followers 0
Libre

Trying To Capture A Button Click Inside An Htlm

2 posts in this topic

First i was needed a listview with buttons for each line, then i decided to do with an html file but i need to catch the button click inside the ieObject. To run the apropiate Function inside my script.

Here is the code, i only need the way to capture the .onclick event in the button objetc. But i dont know how

:)

there is the html file too. Please , help me .

#include <IE.au3>
#include <Constants.au3>
#include <GuiConstants.au3>


$GUI = GuiCreate("", 480, 450,-1, -1 )

    $oIEConsejo = ObjCreate("Shell.Explorer.2")
    $GUIActiveXConsejo = GUICtrlCreateObj($oIEConsejo, 20, 60, 440,260)
    GUICtrlSetStyle($GUIActiveXConsejo, $WS_VISIBLE)
    $oIEConsejo.navigate (@ScriptDir & "\test.html")
        
    
    $oForm = _IEFormGetObjByName($oIEConsejo, "form1")
    $oRegion = _IEFormElementGetObjByName($oForm, "btnG")
        
    MsgBox(0,"",_IEFormElementGetValue($oRegion))
    
    $oRegion.onclick = "hello()" ;s ?
    
    GuiSetState()
    
while 1
    $msg = GuiGetMsg()
     if $msg = $GUI_EVENT_CLOSE then ExitLoop
WEnd 

func hello()
    MsgBox(0,"","hi!")
EndFunc

test.html


I love this Game :p----------------------Freeware Multilange support or Translate your scripts----------------------aNyBoDy KnOwS WhY A LiGhT iN My KeYbOaRd iS aLlWaIs BlInKiNg !?Who is "General Failure" and what is he doing in my hard disk !!!!!?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

well i did, this morning i had no idea of javascript ,but there was the solution.

Now works. :mellow:

can any "guru" say me if this is "trycky" ? :)

#include <GuiConstants.au3>

$GUI = GuiCreate("", 480, 450,-1, -1 )

    $oIEConsejo = ObjCreate("Shell.Explorer.2")
    $GUIActiveXConsejo = GUICtrlCreateObj($oIEConsejo, 20, 60, 440,260)
    GUICtrlSetStyle($GUIActiveXConsejo, $WS_VISIBLE)
    $oIEConsejo.navigate (@ScriptDir & "\boton.html")
        
    GuiSetState()

$tmpHiddenOld = ""
    
while 1
        
    $tmpHidden = $oIEConsejo.document.forms("oculto").item("campo").value
    
    if $tmpHidden <> $tmpHiddenOld Then
            MsgBox(0,"U cliked",$tmpHidden)
            $tmpHiddenOld = $tmpHidden
    EndIf
    
    
    $msg = GuiGetMsg()
     if $msg = $GUI_EVENT_CLOSE then ExitLoop
WEnd

boton.html

Edited by Libre

I love this Game :p----------------------Freeware Multilange support or Translate your scripts----------------------aNyBoDy KnOwS WhY A LiGhT iN My KeYbOaRd iS aLlWaIs BlInKiNg !?Who is "General Failure" and what is he doing in my hard disk !!!!!?

Share this post


Link to post
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
Sign in to follow this  
Followers 0