suroit Posted March 17, 2012 Posted March 17, 2012 Sorry if this has already been discussed, but I spent a lot of time searching the forum, and experimenting... without success.Here is my problem. I am trying to automate a VirtualDubMod.exe video encoding application. Everything works fine, except when I get to this window that contains a listbox (title: "Available Streams".)The AutoIt V3 Window Info says the following:In Basic Control InfoClass: ListboxInstance: 1in the Control tab:Class: ListboxInstance: 1ClassnameNN: Listbox1Advanced (Class) [CLASS: Listbox, INSTANCE: 1]ID: 1402Text (blank)...The listbox may contain one or several items describing video streams, and I would like to do several things:(1) Find an item that contains a specific string, and then select that item (that might be the most critical)Other things I'd like to do, but not critically important:(2) be able to select an item by rank: #1 or #3(3) read the strings in the items in the listbox(4) and/or find out how many items are in the listbox(5) or, (lower priority) right click on each item and select one of the actions on the context menu, for example "Direct Stream Copy" or "Full Processing"I have tried to do this, hoping to identify the item that contains: "Long_amer_drag.ac3"WinWait("Available streams") $r = ControlCommand("Available streams", "", "[CLASSNN:ListBox1]", "FindString", "Long_amer_drag.ac3") MsgBox(4096, "Audio streams", " Reference $r = " & $r)I get $r = 0 (the item that contains the string is in 2nd position), so that must be wrong.I also tried, hoping to select the right item:WinWait("Available streams") $r = ControlCommand("Available streams", "", "[CLASSNN:ListBox1]", "SelectString", "Long_amer_drag.ac3") MsgBox(4096, "Audio streams", " Reference $r = " & $r)I also get $r = 0, and the selection doesn't move to the right item.I haven't found many options to pursue. I hope someone will be able to point me in the right direction.Thanks.
JohnOne Posted March 17, 2012 Posted March 17, 2012 Try replacing [ClassnameNN: Listbox1] with [CLASS: Listbox, INSTANCE: 1] AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
suroit Posted March 17, 2012 Author Posted March 17, 2012 Thanks for the suggestion. Unfortunately, same result: I get $r = 0.
suroit Posted March 18, 2012 Author Posted March 18, 2012 For what it's worth, I also followed stilllife's in another post:#include <GuiListBox.au3> WinWait("Available streams") $hdlList = ControlGetHandle("Available streams", "", "[CLASS: Listbox, INSTANCE: 1]") _GUICtrlListBox_ClickItem($hdlList, 1, "right")Hoping Item 1 (the second one) would get selected and the context menu would show up.Strangely enough, a context menu appears, but unrelated to the target window. I get the desktop context menu instead!
JohnOne Posted March 18, 2012 Posted March 18, 2012 Did you campare the handle from ControlGetHandle to the handle shown in win info tool? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
suroit Posted March 18, 2012 Author Posted March 18, 2012 Good point. I just did, ControlGetHandle gets a blank handle. Is there another way to get the handle?
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