ODell Posted May 19, 2009 Share Posted May 19, 2009 Ok, after looking over the help files and searching for hours on the form, I am now at the point of asking for help. I have read several threads where people need the ability to click on certain text in a window. Looks like there has not been a solution to this problem. Ha anyone come up with a solution that does not require mouse movements and coordinates to used. I am creating a script that will be used in a production enviroment to do some performance benchmarks and will have to very carefull that I am clicking on the correct text. If any one can point me in the right direction, I would appreaciate it. Link to comment Share on other sites More sharing options...
Zedna Posted May 19, 2009 Share Posted May 19, 2009 (edited) Lokk at ControlGetText()ControlClick()Maybe also look at ImageSearch()http://www.autoitscript.com/forum/index.ph...st&p=488195 Edited May 19, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ODell Posted May 19, 2009 Author Share Posted May 19, 2009 Thanks for the responce but I have tried controlCLick and it needs to use cordinates. The text could be anywhere on the screen, I would not know the cords. As this is text the image selection would not work unless I create an image for all the text that I would be looking for. Link to comment Share on other sites More sharing options...
Zedna Posted May 19, 2009 Share Posted May 19, 2009 Here is example (from helpfile) how to enumerate all windows. You can accomodate it to enumerate also controls inside windows and test its text. ; Create callback function $handle = DLLCallbackRegister ("_EnumWindowsProc", "int", "hwnd;lparam") ; Call EnumWindows DllCall("user32.dll", "int", "EnumWindows", "ptr", DllCallbackGetPtr($handle), "lparam", 10) ; Delete callback function DllCallbackFree($handle) ; Callback Procedure Func _EnumWindowsProc($hWnd, $lParam) If WinGetTitle($hWnd) <> "" And BitAnd(WinGetState($hWnd), 2) Then $res = MsgBox(1, WinGetTitle($hWnd), "$hWnd=" & $hWnd & @CRLF & "lParam=" & $lParam & @CRLF & "$hWnd(type)=" & VarGetType($hWnd)) If $res = 2 Then Return 0 ; Cancel clicked, return 0 to stop enumeration EndIf Return 1 ; Return 1 to continue enumeration EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ODell Posted May 19, 2009 Author Share Posted May 19, 2009 (edited) Thanks for the help, but I do not have any problems finding windows or manipulating controls, the problem is clicking on specific text on 3rd party controls. The control I am working against is a grid with columns and rows. The problem is that it is not recognized as a table but one big object. Hence I cannot select a roe or column. For this reason I need to select specific text. See the attached image for example of the application. I would need to select a patient name in order to click on the buttons on the left, or to do any thing else with that patient. As this is to be used in production when a customer has problems It has to be accurate on the patient is working on. Edited May 19, 2009 by ODell Link to comment Share on other sites More sharing options...
ODell Posted May 20, 2009 Author Share Posted May 20, 2009 Does any one know of scripting language that could do this (vb, perl, python). Link to comment Share on other sites More sharing options...
Inverted Posted May 20, 2009 Share Posted May 20, 2009 It's not a matter of a language, this task is too difficult. Maybe you can send keystrokes ? Like, if there is a search box, you can "type" in there the exact patient number and then there will be only one field to click ? Or that program you're using has some plugin support or can accept commandline parameters ? Link to comment Share on other sites More sharing options...
ODell Posted May 20, 2009 Author Share Posted May 20, 2009 (edited) Any of the "OFF THE SHELF TEST TOOLS" can do a Text Select and click the text in the window, so I know that it can be done. Might have to create my own DLL to do this. Edited May 20, 2009 by ODell 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