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(...