Jump to content

ListBox GetText not returning all visible text


hottehead
 Share

Recommended Posts

Hello,

i have a list Box which shows somewhat like a table like below. When using _GUICtrlListBox_GetText ( https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListBox_GetText.htm) i only get back Item1 / Item2 / Item3 depending on used index. The autoit window inspector also does not show the "Additonal" strings as visible content.

Where are these strings? How can I access them?

Quote

 

------------------------------------------------

Item1   Additonal1.1   Additional1.2

Item2   Additonal2.1   Additional2.2

Item3   Additonal3.1   Additional3.1

------------------------------------------------

 

 

I noted one can use custom string-based ListBox using a special style. But I dont know how to handle those if this is my case.


 

 

 

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks for the answers 😃

The ClassnameNN is ListBox1

This is the code I'm using. The controls are being found and the windowHandle is also found. As said before I get a partial string of the visible text from each item.

Local $listBox = ControlGetHandle($windowHandle, "", "[CLASS:ListBox; INSTANCE:1]")
Local $item1 = _GUICtrlListBox_GetText($listBox, 0)

The GUI is not build with AutoIt.

There must be some deeper nested objects which are not triggered by GetText() but are triggered by the GUI render. Though the inspector does not show more nested controls within the ListBox Control.

Link to comment
Share on other sites

4 hours ago, hottehead said:

in-house app running on XP.

Oh, I don't think UIAutomation will help you much with such of an old software (but try it anyway, one never knows).  Only suggestion that comes to me if UIA doesn't work, is to screen capture the region and use OCR to read the other strings.

Link to comment
Share on other sites

On 8/31/2020 at 5:35 PM, hottehead said:

------------------------------------------------

Item1   Additonal1.1   Additional1.2

Item2   Additonal2.1   Additional2.2

Item3   Additonal3.1   Additional3.1

------------------------------------------------

This looks more like a ListView than a ListBox. Are you sure it is a ListBox ?

Some of my script sourcecode

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