Jump to content

Detect Button Click


Kash
 Share

Recommended Posts

Hi,

Using AutoIT i would like to monitor a button click. i.e. Whenever a submit button is clicked, i want to read value in one

text box and add it in a database along with some other parameters.

Is there any way to do it?

e.g. Whenever a button is clicked, pick up values from text box and call a database store procedure to enter values in Database.

Please let me know.

Thank you!

Link to comment
Share on other sites

  • Moderators

Kash,

I presume you are asking about monitoring an external application rather than your own AutoIt creation. If this is the case, you may find this thread useful.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Kash,

I presume you are asking about monitoring an external application rather than your own AutoIt creation. If this is the case, you may find this thread useful.

M23

Thank you....Sorry I was not clear. The solutions y ou ahve provided are for GUI created by AutoIT.

I need to monitor a button click event in IE browser. i.e. in IE browser when a user clicks on submit button, i want to read value of a text box.

Please let me know.

thank you..

Link to comment
Share on other sites

Kash, you are wrong. The info Melba gave you IS for an EXTERNAL application.

8)

Ya but external application in my case is IE browser.

Using autoIT program I need to monior button click event in IE broswer....

Link to comment
Share on other sites

OK, can you give some more info???

code you have thus far ?

Website ?

etc?

8)

OK here is what i want to do..

I have an IE browser window with title "XYZ". It has a text box & a button "Submit".

User of IE browser enters value in text box and hits Submit button.

After hitting Submit button, i want to read value of that text box and enter it in database.

this should happen everytime a user clicks on search button. i.e. Program should monitor Submit Button click event.

Once event is occoured, read value of text box and enter it in DB. I have figured out how to read value of IE text

value. But i am unable to monitor button click event and trigger program.

Below is sample code to read value from text box and insert it in DB..

#include <IE.au3>

Global $BAN

;This function will attach IE browser with specific title to AutoIt program

$oIE = _IEAttach ("XYZ")

$oSubmit= _IEGetObjById ($oIE, "subscriberId")

;This function will return value of text box subscriberId

$BAN = _IEFormElementGetValue($oSubmit)

;Code to run database query.

$conn = ObjCreate( "ADODB.Connection" )

$DSN = "Driver={Microsoft ODBC for Oracle};Server=XX;Uid=YY;Pwd=ZZ;"

$conn.Open($DSN)

$rs = ObjCreate( "ADODB.RecordSet" )

$rs.Open( "Insert Query", $conn )

$conn.clos

I hope this helps.

Regards

Kash

Link to comment
Share on other sites

can you idle around and wait for the info. That means the 'event has happened

ie...

While 1
    $BAN = _IEFormElementGetValue($oSubmit)

    If $BAN <> 0 Then ExitLoop
    ; that means it recieved some data

    Sleep(100)
WEnd

; .... or

While 1
    $oSubmit= _IEGetObjById ($oIE, "subscriberId")

    If $oSubmit <> 0 Then ExitLoop
    ; that means it recieved some data

    Sleep(100)
WEnd

8)

NEWHeader1.png

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...