Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. "Catching" messages to the tab control on a PropertySheet?

"Catching" messages to the tab control on a PropertySheet?

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phil Benson
    wrote on last edited by
    #1

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

    Who the F*** is general failure and why is he reading my hard drive?

    P 1 Reply Last reply
    0
    • P Phil Benson

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

      P Offline
      P Offline
      Phil Benson
      wrote on last edited by
      #2

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

      Who the F*** is general failure and why is he reading my hard drive?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups