Get last item in branch
Posted
by Zafir Anjum
on August 6th, 1998
// GetLastItem - Gets last item in the branch
// Returns - Last item
// hItem - Node identifying the branch. NULL will
// return the last item in outine
HTREEITEM CTreeCtrlX::GetLastItem( HTREEITEM hItem )
{
// Last child of the last child of the last child ...
HTREEITEM htiNext;
if( hItem == NULL ){
// Get the last item at the top level
htiNext = GetRootItem();
while( htiNext ){
hItem = htiNext;
htiNext = GetNextSiblingItem( htiNext );
}
}
while( ItemHasChildren( hItem ) ){
htiNext = GetChildItem( hItem );
while( htiNext ){
hItem = htiNext;
htiNext = GetNextSiblingItem( htiNext );
}
}
return hItem;
}

Comments
Little problem ???
Posted by Legacy on 11/05/1998 12:00amOriginally posted by: Patrice Lacroix
Reply