Kash Posted April 22, 2009 Posted April 22, 2009 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!
Yashied Posted April 22, 2009 Posted April 22, 2009 http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Moderators Melba23 Posted April 22, 2009 Moderators Posted April 22, 2009 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Kash Posted April 22, 2009 Author Posted April 22, 2009 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..
Valuater Posted April 22, 2009 Posted April 22, 2009 Kash, you are wrong. The info Melba gave you IS for an EXTERNAL application. 8)
Kash Posted April 22, 2009 Author Posted April 22, 2009 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....
Valuater Posted April 23, 2009 Posted April 23, 2009 (edited) OK, can you give some more info??? code you have thus far ? Website ? etc? 8) Edited April 23, 2009 by Valuater
Kash Posted April 23, 2009 Author Posted April 23, 2009 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.closI hope this helps.RegardsKash
Valuater Posted April 23, 2009 Posted April 23, 2009 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)
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