Geethu Posted April 22, 2014 Posted April 22, 2014 Hi, I just want to select an item from a treeview. I tried the following : $selectedItem = ControlTreeView($wndHandle, "", "[NAME:tree]", "GetText", "#1") ; this for selecting the first item. Sample tree view is attached with this. Could you please help me?
hellovivz Posted April 22, 2014 Posted April 22, 2014 (edited) Try using the below examples. #include <GuiTreeView.au3> $hTreeView = ControlGetHandle($GUIhandle, "", "[CLASS:SysTreeView32; INSTANCE:4]") ; The class for tree. Before that get the GUI handle $hTMP = _GUICtrlTreeView_FindItem($hTreeView, $Treename, True) ; $treename = tree name if the main tree has a name. If $hTMP Then _GUICtrlTreeView_Expand($hTreeView,$hTMP, True) Sleep(1000) $ret = _GUICtrlTreeView_GetText($hTreeView, $Treename) Endif If _GUICtrlTreeView_GetChildren($hTreeView, $hTMP) Then $hchild = _GUICtrlTreeView_GetFirstChild($hroot, $hparent) while $hchild $cText = _GUICtrlTreeView_GetText($hroot, $hchild) ;Do whatever you want $hchild = _GUICtrlTreeView_GetNextChild($hroot, $hchild) WEnd Endif Note: This is not a complete code. This is just an example Edited April 22, 2014 by hellovivz
Geethu Posted April 23, 2014 Author Posted April 23, 2014 Hi hellovivz, Thanks for your reply. Its not working for me, because the treeView is non GUI control. It is a window control.
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