Finding an item in TreeCtrl (recursive function)
Posted
by Yura Khodak
on October 2nd, 1998
HTREEITEM CTreeCtrlX::FindData(HTREEITEM hti, DWORD dwData)
{
if(hti == NULL) return NULL;
if(GetItemData( hti ) == dwData)
{
Select( hti, TVGN_CARET);
EnsureVisible( hti );
return hti;
}
hti = GetChildItem( hti );
do
{
HTREEITEM hti_res;
if((hti_res = FindData( hti, dwData)) !=NULL )
return hti_res;
}while( (hti = GetNextSiblingItem( hti )) != NULL );
return NULL;
}

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