BCGControlBar Pro for MFC
BOOL CBCGPTasksGroup::m_bIsCollapsed

Holds the current state of the group. If TRUE - the group is collapsed; if FALSE - the group is expanded.

You can enable or disable collapsing of all groups on the task pane using CBCGPTasksPane::EnableGroupCollapse.