Copy a branch
Posted
by Zafir Anjum
on August 6th, 1998
// CopyBranch - Copies all items in a branch to a new location
// Returns - The new branch node
// htiBranch - The node that starts the branch
// htiNewParent - Handle of the parent for new branch
// htiAfter - Item after which the new branch should be created
HTREEITEM CTreeCtrlX::CopyBranch( HTREEITEM htiBranch, HTREEITEM htiNewParent,
HTREEITEM htiAfter /*= TVI_LAST*/ )
{
HTREEITEM hChild;
HTREEITEM hNewItem = CopyItem( htiBranch, htiNewParent, htiAfter );
hChild = GetChildItem(htiBranch);
while( hChild != NULL)
{
// recursively transfer all the items
CopyBranch(hChild, hNewItem);
hChild = GetNextSiblingItem( hChild );
}
return hNewItem;
}

Comments
There are no comments yet. Be the first to comment!