Jump to content

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


 Share

Recommended Posts

?

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
Link to comment
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.

Link to comment
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:

Link to comment
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
Link to comment
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:)

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