dwStyle &= ~(MFS_MOVEFRAME|MFS_4THICKFRAME);
#endif
if (!CMiniFrameWnd::CreateEx(dwExStyle,
NULL, &afxChNil, dwStyle, rectDefault, pParent))
{
m_bInRecalcLayout = FALSE;
return FALSE;
}
dwStyle = dwBarStyle & (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) ?
CBRS_ALIGN_LEFT : CBRS_ALIGN_TOP;
dwStyle |= dwBarStyle & CBRS_FLOAT_MULTI;
CMenu* pSysMenu = GetSystemMenu(FALSE);
//pSysMenu->DeleteMenu(SC_SIZE, MF_BYCOMMAND);
CString strHide;
if (strHide.LoadString(AFX_IDS_HIDE))
{
pSysMenu->DeleteMenu(SC_CLOSE, MF_BYCOMMAND);
pSysMenu->AppendMenu(MF_STRING|MF_ENABLED, SC_CLOSE, strHide);
}
// must initially create with parent frame as parent
if (!m_wndDockBar.Create(pParent, WS_CHILD | WS_VISIBLE | dwStyle,
AFX_IDW_DOCKBAR_FLOAT))
{
m_bInRecalcLayout = FALSE;
return FALSE;
}
// set parent to CMiniDockFrameWnd
m_wndDockBar.SetParent(this);
m_bInRecalcLayout = FALSE;
return TRUE;
}
void CSCBMiniDockFrameWnd::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
if (nHitTest == HTCAPTION || nHitTest == HTCLOSE)
{
baseCSCBMiniDockFrameWnd::OnNcLButtonDown(nHitTest, point);
return;
}
if (GetSizingControlBar() != NULL)
CMiniFrameWnd::OnNcLButtonDown(nHitTest, point);
else
baseCSCBMiniDockFrameWnd::OnNcLButtonDown(nHitTest, point);
}
CSizingControlBar* CSCBMiniDockFrameWnd::GetSizingControlBar()
{
CWnd* pWnd = GetWindow(GW_CHILD); // get the dockbar
if (pWnd == NULL)
return NULL;
pWnd = pWnd->GetWindow(GW_CHILD); // get the controlbar
if (pWnd == NULL)
return NULL;
if (!pWnd->IsKindOf(RUNTIME_CLASS(CSizingControlBar)))
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-36846-34.html
可见一斑