Sign in to follow this  
Followers 0
sJoe

Reading text from a list object in another window

9 posts in this topic

Hey there,

I have spent a few hours searching the forums and the web as well as playing around with ControlGetText and have been unable to even get the first part of my project started. I am looking to read the text of list items in a ListBox object of an application. I have used automate to browse the list so I know the data is there and not hidden or in a custom class. I have access to the window class, object class and ID. My end goal is to be able to read the content in the list in real time so I can execute certain actions when items appear in the list.

Is there an existing function or script that allows me to extract the entire list and parse it or loop through a list and read items one at time? Either will suffice.

Thanks in Advance,

Joe

Share this post


Link to post
Share on other sites



Look at ControlCommand()

Hey Zedna,

I just looked at the commands available to ControlCommand() as I interpret the options it does not seem I can read the text from the list box unless the item is selected. The list box I am trying to read from is constantly being updated with new entries. I am trying to read the content of the the entire box or at least the last 10 items in it. Is that possible with an option available to ControlCommand() ?

Thanks,

Joe

Share this post


Link to post
Share on other sites

Then look at:

#include <GUIListBox.au3>

ControlGetHandle()

_GUICtrlListBox_GetCount()

_GUICtrlListBox_GetText()

Hey Zedna,

That is EXACTLY what I was looking for =) It works perfect!

Thanks a ton -

Joe

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok, new issue:

[uPDATE]

I've done a bit more digging and determined the entries in the list box may be in some sort of array data container or another data type. Any thoughts on how to go about getting that data out, at least in its raw format, so I can attempt to sort it for my use?

[/uPDATE]

When I try to obtain text from a listbox that has multiple columns it just returns 1 as the text. There are 8 columns in this particular ListBox. Other functions like _GUICtrlListBox_GetCount work fine and return the right count so I know I am talking to the right control. Also, if return the text without processing it using the DLLStructGetData($struct, "Text") aspect of GuiListBox.au3 it returns "4" if that means anything to anyone.

Thanks, once again, in advanced -

Joe

Edited by sJoe

Share this post


Link to post
Share on other sites

Are you sure it's ListBox?

ListBoxes usualy don't have more columns (it can be achieved by @TAB character though).

For more columns is obviously used ListView control instead.

Use Au3Info tool to get ClassName of your target control.

And post screenshot of it.

Share this post


Link to post
Share on other sites

Are you sure it's ListBox?

ListBoxes usualy don't have more columns (it can be achieved by @TAB character though).

For more columns is obviously used ListView control instead.

Use Au3Info tool to get ClassName of your target control.

And post screenshot of it.

Here is the information from the summary page:

Window:

Class: TfrmMain.UnicodeClass

Control:

TTntListBox.UnicodeClass

Advanced(Class): [CLASS: TTntListBox.UnicodeClass]

Text:

Nothing in Visible / Hidden Text.

--

I currently have a portion of my application working with other list box in the same program they are single column only however. They also have the same class name.

- Joe

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