Burgs Posted June 20, 2012 Posted June 20, 2012 Hello, I am trying to manipulate an application that has a "TreeView" list within it. I am using the "_GUICtrlTreeView_FindItem" command to search for the desired "child" branch in the TreeView, and upon finding it then assigning it a handle so as to "double click" that child so as to open/expand it... $hHandle = ControlGetHandle("History", "", "[CLASS:SysTreeView32; INSTANCE:1]") $hItemFound = _GUICtrlTreeView_FindItem($hHandle, "APPLES", TRUE) If $hItemFound Then MsgBox(4160, "Information", "Item Found:") $hItem = ControlGetHandle($hItemFound, "", "[CLASS:SysTreeView32; INSTANCE:1]") _GUICtrlTreeView_ClickItem($hHandle, $hItem, "left", False, 2) EndIf The above code does not throw any error and it seems to run OK, however I do not see the "TreeView" within the application expanding on the desired child, or doing anything at all. What am I missing here? I have not tried to manipulate TreeView commands before so if somebody could inform what I am not understanding I would greatly appreciate it...thank you in advance.
AdmiralAlkex Posted June 20, 2012 Posted June 20, 2012 I don't have AutoIt on this machine, but clicking an item to expand it sounds a bit wrong. I would look if there isn't a function that directly expands. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Burgs Posted June 20, 2012 Author Posted June 20, 2012 Hello, I replaced that "ClickItem" line with: ControlTreeView("History", $hItemFound, "[CLASS:SysTreeView32; INSTANCE:1]", "Expand", "Heading1") However it doesn't seem to have made a difference...
zorphnog Posted June 20, 2012 Posted June 20, 2012 (edited) As @AdmiralAlkex said, use _GUICtrlTreeView_Expand instead of _GUICtrlTreeView_ClickItem. Edit: Also, you do not need to use ControlGetHandle on $hItemFound. It is already a handle. Edited June 20, 2012 by zorphnog
Burgs Posted June 20, 2012 Author Posted June 20, 2012 Thanks, I added these lines: _GUICtrlTreeView_Expand($hHandle, 0, False) ;COLLAPSE ALL _GUICtrlTreeView_Expand($hHandle, $hItemFound, True) It does successfully collapse all of the TreeView items however I still cannot get the desired 'child' to expand...the only thing I have had success with is expanding ALL the TreeView items...?
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