if (GetItemState(hItem, TVIS_EXPANDED) & TVIS_EXPANDED)
{
// hItem is expanded
}
else
// hItem is collapsed
I've seen GetItemState return MORE states than the ones I asked it for, I've made it a habit to explicitly test the returned state again (sigh), hence the "& TVIS_EXPANDED" which shouldn't be required.
if (GetItemState(hItem, TVIS_EXPANDED) & TVIS_EXPANDED)
{
// hItem is expanded
}
else
// hItem is collapsed
I've seen GetItemState return MORE states than the ones I asked it for, I've made it a habit to explicitly test the returned state again (sigh), hence the "& TVIS_EXPANDED" which shouldn't be required.
Thank you. I had just this problem and why your post had shown on a search. Fixed it in my ctrlext.ini as:
CTLEXT_INLINE bool CTreeCursor::IsExpanded( ) const { return TreeView_GetItemState( *m_pTree, m_hTreeItem, TVIS_EXPANDED ) & TVIS_EXPANDED; }
Bookmarks