CTreeCtrl::GetSelectedItem
Call this function to retrieve the currently selected item of the tree view control.
HTREEITEM GetSelectedItem( ) const;
Возвращаемое значение
The handle of the selected item; otherwise NULL.
Пример
// Expand the selected item and make it visible, if possible.
HTREEITEM hItem = m_TreeCtrl.GetSelectedItem();
if ((hItem != NULL) && m_TreeCtrl.ItemHasChildren(hItem))
{
m_TreeCtrl.Expand(hItem, TVE_EXPAND);
m_TreeCtrl.EnsureVisible(hItem);
}
Требования
Header: afxcmn.h