Jump to content
Sign in to follow this  
Sathya

How to get children using tree view

Recommended Posts

Sathya

How to get children using tree view. For e.g, i have a tree "parent" in which there are four children "Child1", "Child2", "Child3", "Child4". i need to get the names of all the children under "parent". I tried using _guiCtrltreeview_getfirstchild and _guiCtrltreeview_getnextchild. how to get the names???

Thanks, sathya

Share this post


Link to post
Share on other sites
water

After getting the handle of the children using _guiCtrltreeview_getfirstchild and _guiCtrltreeview_getnextchild use Function _GUICtrlTreeView_GetText to get the text of the item:

$hItem = _guiCtrltreeview_getnextchild($hWnd)
$sItemtext = _GUICtrlTreeView_GetText($hItem)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Sathya

After getting the handle of the children using _guiCtrltreeview_getfirstchild and _guiCtrltreeview_getnextchild use Function _GUICtrlTreeView_GetText to get the text of the item:

$hItem = _guiCtrltreeview_getnextchild($hWnd)
$sItemtext = _GUICtrlTreeView_GetText($hItem)

i used the same what you told but i'm getting only "child 1" and "child 2". i also need text of "child 3" and "child 4"

Share this post


Link to post
Share on other sites
water

You have to retrieve the childs in a loop until

_GUICtrlTreeView_GetNextChild($hWnd) = 0

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×