"Catching" messages to the tab control on a PropertySheet?
-
Does anyone know "offhand" how I can intercept when the user clicks on a Tab (Tabcontrol) on a propertysheet (that is not in wizard mode,) or uses the keyboard to navigate between property pages on a property sheet. I would like (under certain circumstances) to disable the user from changing between property pages on the property sheet, but stll be able to do this programatically. Thanks in advance Phil bum... and I thought I´d got rid of all the bugs :(
-
Does anyone know "offhand" how I can intercept when the user clicks on a Tab (Tabcontrol) on a propertysheet (that is not in wizard mode,) or uses the keyboard to navigate between property pages on a property sheet. I would like (under certain circumstances) to disable the user from changing between property pages on the property sheet, but stll be able to do this programatically. Thanks in advance Phil bum... and I thought I´d got rid of all the bugs :(
Oh well... solved the problem myself in the end... here is what I came up with incase anyone has a similar situation. Override the PreTranslateMessage function in your CPropertySheet derived class... BOOL CmyDerivedClass::PreTranslateMessage(MSG* px_msg){ if(m_bStopUserClickingonTabs && (px_msg->message == WM_LBUTTONDOWN || px_msg->message == WM_LBUTTONUP)) { // Get the Tabl Control // ******************** CTabCtrl* pTabCtrl = GetTabControl(); ASSERT(NULL != pTabCtrl && ::IsWindow(pTabCtrl->m_hWnd)); if(NULL != pTabCtrl && ::IsWindow(pTabCtrl->m_hWnd)){ CRect rect; pTabCtrl->GetClientRect(&rect); if(rect.PtInRect(px_msg->pt)){ return TRUE; } } } // Call the base class // ******************* return CPropertySheet::PreTranslateMessage(px_msg); } This will not of course stop the user using the keybaord to switch between property pages, but this is sufficiant for my needs. If anyone has a more "elegant" method, then please, drop a line... mfg Phil bum... and I thought I´d got rid of all the bugs :(