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. ATL / WTL / STL
  4. Problems with MFCTabCtrl/MDITabbedControl

Problems with MFCTabCtrl/MDITabbedControl

Scheduled Pinned Locked Moved ATL / WTL / STL
announcement
1 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.
  • D Offline
    D Offline
    Dansveen
    wrote on last edited by
    #1

    Hi all I have a problema with MDITabbedControl. - Open multiple MDI tab screens - Select a tab from one of them and start moving it. Drop it on the "X" thing that closes the screen from another tab - Now move your mouse over the other tabs. As the mouse passes over the tab, the tab still captured, mouse doesn't release the capture. I try overloading pretranslatemsg, catching the message WM_LBUTTONUP, but still happens when during a drag/drop I click on close button. This is my code:

    switch (pMsg->message)
    {
    case WM_LBUTTONUP:
    {
    CWnd* pWnd = FromHandle(pMsg->hwnd);
    CMFCTabCtrl* tabGroup = dynamic_cast<CMFCTabCtrl*>(pWnd);
    if (tabGroup)
    {
    CPoint clickLocation = pMsg->pt;
    tabGroup->ScreenToClient(&clickLocation);
    int tabIndex = tabGroup->GetTabFromPoint(clickLocation);
    if (tabIndex >= 0)
    {
    CWnd* pTab = tabGroup->GetTabWnd(tabIndex);
    if (pTab && tabGroup->IsTabCloseButtonHighlighted() && tabGroup->IsTabCloseButtonPressed())
    {
    pTab->SendMessage(WM_CLOSE, 0, 0);
    }
    }
    }
    break;
    }
    default:
    {
    break;
    }
    }

    return CMDIFrameWndEx::PreTranslateMessage(pMsg);
    
    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