Hi,
I'm sure this is outdated question, but here's the straight answer.
Add this to you message map in MainFrm.cpp:
ON_REGISTERED_MESSAGE(AFX_WM_ON_CHANGE_RIBBON_CATEGORY, OnRibbonCategoryChanged)
then, declare and implement method
OnRibbonCategoryChanged
:
LPARAM CMainFrame::OnRibbonCategoryChanged(WPARAM wp, LPARAM lp)
{
CMFCRibbonCategory *pCategory=m_wndRibbonBar.GetActiveCategory();
int nCategory=m_wndRibbonBar.GetCategoryIndex(pCategory);
return 0;
}
The
nCategory
variable holds current category index (starting with one, left to right).