title: How to catch CTabView close button pressed?
body: <p>I'm writing an app in MFC with tabs. I'm extending <code>CTabView</code> class with my own.<br><br>
  I want to catch event while closing active tab and actually remove it from TabView.<br><br>
  The message <code>WM_LBUTTONUP</code> is never handled here - it's not handlen in ANY child class - what am I doing wrong?<br><br>
  Where I can catch event when I'm closing active tab?</p>
  
  <pre><code>IMPLEMENT_DYNCREATE(CBottomTabView, CTabView)
  
  BEGIN_MESSAGE_MAP(CBottomTabView, CTabView)
      ON_WM_CREATE()
      ON_WM_LBUTTONUP()
  END_MESSAGE_MAP()
  
  CBottomTabView::CBottomTabView()
  {
  }
  
  CBottomTabView::~CBottomTabView()
  {
  }
  
  
  BOOL CBottomTabView::PreCreateWindow(CREATESTRUCT&amp; cs) 
  {
      if (!CTabView::PreCreateWindow(cs))
          return FALSE;
  
      cs.dwExStyle |= WS_EX_CLIENTEDGE;
      cs.style &amp;= ~WS_BORDER;
      cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
          ::LoadCursor(NULL, IDC_ARROW), reinterpret_cast&lt;HBRUSH&gt;(COLOR_WINDOW+1), NULL);
  
      return TRUE;
  }
  
  int CBottomTabView::OnCreate(LPCREATESTRUCT lpCreateStruct)
  {
      if (CTabView::OnCreate(lpCreateStruct) == -1)
          return -1;
  
      GetTabControl().SetLocation(CMFCBaseTabCtrl::LOCATION_BOTTOM);
      GetTabControl().ModifyTabStyle(CMFCTabCtrl::STYLE_3D_ONENOTE);
      GetTabControl().EnableTabDocumentsMenu(TRUE);
      GetTabControl().EnableActiveTabCloseButton(TRUE);
      GetTabControl().EnableTabSwap(TRUE);
  
      AddView(RUNTIME_CLASS(CLogView),_T("Log"));
      AddView(RUNTIME_CLASS(CLogView),_T("Log2"));
      AddView(RUNTIME_CLASS(CLogView),_T("Log3"));
      return 0;
  }
  
  // This method is never handled!!!
  void CBottomTabView::OnLButtonUp(UINT nFlags, CPoint point)
  {
  
      int nTab = GetTabControl().GetTabFromPoint(point);
      GetTabControl().SetActiveTab(nTab);
      if (GetTabControl().IsTabCloseButtonPressed())
      {
          RemoveView(nTab);
      }
      else
      {
          CTabView::OnLButtonUp(nFlags, point);
      }
  
  }
  
  // This metod is handled only when changing the tab
  void CBottomTabView::OnActivateView(CView* view)
  {
      CTabView::OnActivateView(view);
  }
  </code></pre>