Jump to content

Reading Text Under The Cursor


Recommended Posts

I am attempting to automate the execution of a Windows application with a difficult user interface to automate. Basically, this application will present a list of names with check boxes next to them that I can click on to select them. This is not a static list of names, and there is no ability to search for a name by sending the keystrokes.

I am able to click on the top value and use the arrow down to go through each potential user/value. If I could read the text that is in the control under my cursor, I could cycle through all the potential users, and send a space keystroke to select that user. The key is reading the text under my cursor.

Does anyone in the community know if it is possible to get the value of the text under the current location of the cursor, assuming the app is using a grid control (I think it is)?

Thanks!

--George

Link to comment
Share on other sites

In the start menu, use the AutoIT Window Info tool, and drag the corsair onto one of the names...then move over to the last tab of the app, grab all that data, and post it back to us...make sure to remove sensitive information...you can manipulate, loop, based on the control type.

Edited by jdelaney
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

There are actually two different windows where I would like to try to do this. Each summary is shown below. I was not able to get the Window Tool to display any of the text I am looking for... thank you for the quick response!

Window #1

>>>> Window <<<<

Title: Add Cases

Class: TForm_AddEntity

Position: 423, 283

Size: 434, 259

Style: 0x16CC0000

ExStyle: 0x00010100

Handle: 0x00190BEC

>>>> Control <<<<

Class: TListView

Instance: 1

ClassnameNN: TListView1

Name:

Advanced (Class): [CLASS:TListView; INSTANCE:1]

ID: 4266170

Text:

Position: 8, 27

Size: 402, 157

ControlClick Coords: 117, 60

Style: 0x5601C045

ExStyle: 0x00000200

Handle: 0x004118BA

>>>> Mouse <<<<

Position: 556, 400

Cursor ID: 0

Color: 0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

&Select All

Cancel

OK

>>>> Hidden Text <<<<

Window #2

>>>> Window <<<<

Title: Name of Admin Application (http://blah/blah/blah.svc)

Class: TForm_Main

Position: 100, 100

Size: 1080, 625

Style: 0x16CF0000

ExStyle: 0x00050100

Handle: 0x0041064A

>>>> Control <<<<

Class: TcsListView

Instance: 1

ClassnameNN: TcsListView1

Name:

Advanced (Class): [CLASS:TcsListView; INSTANCE:1]

ID: 2888990

Text:

Position: 214, 51

Size: 850, 516

ControlClick Coords: 53, 224

Style: 0x5601104D

ExStyle: 0x00000200

Handle: 0x002C151E

>>>> Mouse <<<<

Position: 375, 405

Cursor ID: 0

Color: 0x5EA7EA

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Main Menu

Standard

App Server (http://blah/blah/blah.svc)

>>>> Hidden Text <<<<

SQL Servers

Link to comment
Share on other sites

try this...replace the actual title in the wingethandle:

If this returns > 0, then you can easily loop through:

(note, have the window running)...this is for window 1

#include <GuiListView.au3>
$hwndWindow = WinGetHandle ( "your title" )
$hwndListView = ControlGetHandle ( $hwndWindow, "", "[CLASS:TListView; INSTANCE:1]" )

msgbox ( 4096, "test count", _GUICtrlListView_GetItemCount ($hwndListView) )
Edited by jdelaney
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

The problem is that the window is in two parts, the left side looks like an embedded tree control, and on the other side of a slider is the content I am looking to traverse. If I select either side with the Window tool, I think I am getting the same control even though only the panel I care about appears selected.

I DO get a value > 0 but it matches the number of items in the tree on the left, not the entries on the right.

Link to comment
Share on other sites

You are going to have a problem with this. I see several indications of that app being written in Delphi and Delphi windows are notoriously difficult to automate.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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