Amani Posted November 17, 2010 Share Posted November 17, 2010 I'm working with a 3rd party app and trying to access/manipulate a ListBox control. I'm able to do a ControlCommand(..."Select String"); likewise, I can do a "GetCurrentSelection". But the ControlListView command invariably fails, using the same title/text/ctrlID arguments. Hence, I cannot observe the options. Since there's some run-time variation in the available options, being able to count and observe them is critical. Any suggestions would be appreciated. Link to comment Share on other sites More sharing options...
Amani Posted November 18, 2010 Author Share Posted November 18, 2010 Still stuck on this guy. Since the LB is in a 3rd-party app, I didn't create it. I've looked at the _GUI* functions, but it looks like those are geared strictly toward GUI elements created by the AutoScript. So, to be clear, the following works fine: ControlCommand($winTitle, $winText, $listBoxCtrlID, _ "SelectString", "foo") But if I try this, the item count always comes back zero, regardless of how many items are in the list ControlListView($winTitle, $winText, $listBoxCtrlID, _ "GetItemCount") Oddly enough, @error is also zero, so the ControlListView call seems happy enough. Any tips would be appreciated. Link to comment Share on other sites More sharing options...
Amani Posted November 18, 2010 Author Share Posted November 18, 2010 Perhaps (being only slightly familiar with Windows programming), "ListView" and "ListBox" are different, and one should not use ControlListView with a ListBox control? Are there other functions beside ControlCommand that might give me visibility to the options available in a ListBox? I haven't found them yet in the function reference. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 Amani,one should not use ControlListView with a ListBox controlCorrect - ListBoxes and ListViews are very different beasts. What does the Au3 Window Info tool tell you about the control, particularly its CLASS? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Amani Posted November 18, 2010 Author Share Posted November 18, 2010 That's what I was afraid of. The class is "ListBox". So, did I just miss some utilities for observing/manipulating ListBox controls? I didn't see a good way to observe the available selections using the ControlCommand function. Really appreciate your feedback. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 Amani,The GUICtrlListBox_* functions might be of use here - look in the Help file under <GUIListBox Management>.But have you tried ControlGetText? If you can get the displayed text and you know the various options you could well be able to parse the result and see what is available at that moment.It is a bit difficult to go any further as I cannot work on the control myself - but the fact that you can get some returns from the control makes me think that there is room for optimism. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Amani Posted November 19, 2010 Author Share Posted November 19, 2010 Okay, that worked, thank you. I was using the online documentation, rather than the help file, so I missed all the _GUICtrlListBox functions that take a handle. I now use ControlGetHandle to get the ListBox control handle. From that, I'm able to use the _GUICtrlListBox functions to examine and manage the list box. Really appreciate the help. 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