AU3Newbie Posted November 30, 2010 Share Posted November 30, 2010 >>>> Control <<<< Class: ListBox Instance: 1 ClassnameNN: ListBox1 Name: Advanced (Class): [CLASS:ListBox; INSTANCE:1] can I get the text from this listbox? Thank you. Link to comment Share on other sites More sharing options...
Montfrooij Posted November 30, 2010 Share Posted November 30, 2010 (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 November 30, 2010 by Montfrooij Link to comment Share on other sites More sharing options...
AU3Newbie Posted November 30, 2010 Author Share Posted November 30, 2010 ?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 More sharing options...
Montfrooij Posted December 1, 2010 Share Posted December 1, 2010 Yes,your're right.That's a 'non AutoIT' program.And do you want the selected item from the listbox, or all available items? Link to comment Share on other sites More sharing options...
AU3Newbie Posted December 1, 2010 Author Share Posted December 1, 2010 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? Link to comment Share on other sites More sharing options...
AU3Newbie Posted December 1, 2010 Author Share Posted December 1, 2010 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. Link to comment Share on other sites More sharing options...
Montfrooij Posted December 1, 2010 Share Posted December 1, 2010 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! Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 1, 2010 Share Posted December 1, 2010 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. 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 More sharing options...
AU3Newbie Posted December 1, 2010 Author Share Posted December 1, 2010 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. 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 More sharing options...
AU3Newbie Posted December 2, 2010 Author Share Posted December 2, 2010 After that ,I rewrite the code in AHK by using "ControlGet List" function and set a hotkey to it,very simple indeed:) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now