IonicWind Software

Aurora Compiler => GUI => Topic started by: ExMember001 on September 16, 2006, 09:34:28 PM

Title: Root item in Treeview
Post by: ExMember001 on September 16, 2006, 09:34:28 PM
Is there a way to get the root item handle from one of its children?
Title: Re: Root item in Treeview
Post by: Ionic Wind Support Team on September 16, 2006, 10:31:08 PM
I usually store the parent's handle as the child items user data (SetItemData), which allows for quick traversal back up the tree.

Or you can use the API to get it:


#define TV_FIRST 0x1100
#define TVM_GETNEXTITEM         (TV_FIRST + 10)
#define TVGN_PARENT             0x0003
DECLARE IMPORT,SendMessageA(hwnd as UINT,uMsg as UINT,wParam as UINT,lParam as UINT),UINT;


sub GetParentItem(UINT hTreeView,UINT hChildItem),UINT
{
     return SendMessageA(hTreeView, TVM_GETNEXTITEM, TVGN_PARENT, hChildItem);
}

Title: Re: Root item in Treeview
Post by: Ionic Wind Support Team on September 16, 2006, 10:32:49 PM
Sorry, You asked for the root.  You can use the same method but change TVGN_PARENT to TVGN_ROOT:

#define TVGN_ROOT               0x0000
Title: Re: Root item in Treeview
Post by: ExMember001 on September 16, 2006, 11:09:44 PM
thanks Paul :)