Sign in to follow this  
Followers 0
AU3Newbie

can I get the text from a listbox of [CLASS:ListBox; INSTANCE:1]

10 posts in this topic

>>>> Control <<<<

Class: ListBox

Instance: 1

ClassnameNN: ListBox1

Name:

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

can I get the text from this listbox?

Thank you.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

?

I'm assuming you have a menu from a 'non AutoIT' program with some control and you want to find the 'value' that is present there?

Or do you want all the available options in the listbox?

Please be more specific about what you want.

EDIT : (added the 'non AutoIT')

Edited by Montfrooij

Share this post


Link to post
Share on other sites

?

I'm assuming you have a menu from a 'non AutoIT' program with some control and you want to find the 'value' that is present there?

Or do you want all the available options in the listbox?

Please be more specific about what you want.

EDIT : (added the 'non AutoIT')

Yes,your're right.

That's a 'non AutoIT' program.

Share this post


Link to post
Share on other sites

Yes,your're right.

That's a 'non AutoIT' program.

And do you want the selected item from the listbox, or all available items?

Share this post


Link to post
Share on other sites

And do you want the selected item from the listbox, or all available items?

I can select it ,but cannot copy the text.

I'd like to get all the items and copy them to a text file.

Can u help me?

Share this post


Link to post
Share on other sites

BTW,AutoIt Window Info Tool cannot get the text from the listbox.To get the list items,maybe need I use WINAPI of send MESSAGE.........All those is so difficult to me to master unless there's some example codes.

Share this post


Link to post
Share on other sites

BTW,AutoIt Window Info Tool cannot get the text from the listbox.To get the list items,maybe need I use WINAPI of send MESSAGE.........All those is so difficult to me to master unless there's some example codes.

As GaryFrost you'll need to learn about the DllCall function, also you'll have to research the ComboBox control, SendMessage at MSDN.

So it should be possible.

Until today I didn't have the need to do such things (Until now I've only created my own 'software' using AutoIT and did not need to interfere other's). So my knowledge stops here.

A quick 'google' for autoit DllCall function, ComboBox control, SendMessage does give some hints however.

For example, look at

Good luck! :graduated:

Share this post


Link to post
Share on other sites

You may find that implemented already in _GUICtrlListBox_GetText(). Or you could try ControlCommand() with the "GetCurrentSelection" option. See help file.

Neither will get all items at once, so you would have to loop through the items to get them all. The _GUICtrlListBox_GetText() might be better for that because it doesn't require the item to be selected to read it the way ControlCommand() does.

:graduated:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

You may find that implemented already in _GUICtrlListBox_GetText(). Or you could try ControlCommand() with the "GetCurrentSelection" option. See help file.

Neither will get all items at once, so you would have to loop through the items to get them all. The _GUICtrlListBox_GetText() might be better for that because it doesn't require the item to be selected to read it the way ControlCommand() does.

:(

Thank you very very much,I'v got all what I need.

1st,I use later method to get one,and only the selected one.

next,follow your guide,I use the UDF and a while-loop to get them all. :graduated:

And also thanks to Montfrooij who helped me once more,in fact,to get the text on non-Au3-control is not so difficult indeed:)

Share this post


Link to post
Share on other sites

After that ,I rewrite the code in AHK by using "ControlGet List" function and set a hotkey to it,very simple indeed:) :graduated:

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