Curious52 Posted June 2, 2014 Share Posted June 2, 2014 I am able to use MouseClick to select a TextBox on another application, however I need its ID number to enter a string directly on it (it doesn't have any Title therefore I can't use ControlFocus on it) ! Anyone know any method to find it? Thanks to any help Link to comment Share on other sites More sharing options...
Danp2 Posted June 2, 2014 Share Posted June 2, 2014 Have you tried examining the window / control with AU3Info? You may also want to take a look at ControlGetFocus. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Curious52 Posted June 3, 2014 Author Share Posted June 3, 2014 (edited) Hi Danp2, I have verified a lots functions about GUI controls but I have been in vain (ie: http://www.autoitscript.com/autoit3/docs/functions/), as I mentionned before those functions required Title or handle which I don't have it *) I only can file its related values by using _EnumList function (ID & class), but since it doesn't have the title & the class name having the same with other items (Child windows) therfore I can't get which ID is right (only identifying it by viewing directly to it) Edited June 3, 2014 by Curious52 Link to comment Share on other sites More sharing options...
Malkey Posted June 6, 2014 Share Posted June 6, 2014 After clicking the control ("TextBox") in your script, try using:-ControlSend("", "", "", "The string to be sent") Here is an example script which works.; Run script then:- ; Select (click on) the "TexBox" you wish to send a string to. ; Press "Alt" key and "c" key together to send the string "Sent Text" to the selected "TexBox". ; Press the Esc key to quit. HotKeySet("{ESC}", "Terminate") ; Esc HotKeySet("!s", "_Send") ; Alt+ s Local $a While 1 Sleep(100) WEnd Func Terminate() Exit EndFunc ;==>Terminate Func _Send() ControlSend("", "", "", "Sent Text") ;...........^ The first "" will select the title of the currently active window on which the control can be found. ; The third "" will select the id of the currently active, or selected, control - the "TexBox". EndFunc ;==>_Send Link to comment Share on other sites More sharing options...
reb Posted June 7, 2014 Share Posted June 7, 2014 I believe this > ; Press "Alt" key and "c" key together to send the string "Sent Text" to the selected "TexBox". should read > ; Press "Alt" key and "s" key together to send the string "Sent Text" to the selected "TexBox". REB MEASURE TWICE - CUT ONCE Link to comment Share on other sites More sharing options...
jdelaney Posted June 9, 2014 Share Posted June 9, 2014 Try something like this: #include <WinAPI.au3> Run("notepad.exe") WinWait("[CLASS:Notepad]") Local $sControl = ControlGetFocus("[ACTIVE]") ;~ MsgBox(0, "ControlGetFocus Example", "The control that has focus is: " & $sControl) $hControl = ControlGetHandle("[ACTIVE]","",$sControl) $iControl = _WinAPI_GetDlgCtrlID($hControl) ConsoleWrite($iControl & @CRLF) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
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