Problems with MFCTabCtrl/MDITabbedControl
-
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);