Sign in to follow this  
Followers 0
ODell

Click on Text in window

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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.

post-46274-1242765848_thumb.jpg

Edited by ODell

Share this post


Link to post
Share on other sites

Does any one know of scripting language that could do this (vb, perl, python).

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by ODell

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