用的WTL重画的MDI边框,具体的思路和做法是(具体方法看付件里的源代码)
- 先去掉MDI窗口原有的系统边框
ModifyStyle(m_hWnd,WS_BORDER|WS_THICKFRAME|WS_DLGFRAME,0);
ModifyStyle(m_hWnd,0,WS_CLIPCHILDREN|WS_CLIPSIBLINGS);
- 再在WM_NCCALCSIZE消息里,指定MDI新的系统边框的宽度
NCCALCSIZE_PARAMS* lpncsp = (NCCALCSIZE_PARAMS*)lParam;
if (bCalcValidRects && lpncsp)
{
lpncsp->rgrc[0].left+=m_nBorderPixels+m_nClientBorderPixels;if (!m_bTitleBarInClientArea)
{
lpncsp->rgrc[0].top+=m_nBorderPixels + (m_rcTitle.bottom-m_rcTitle.top)+m_nClientBorderPixels;
}
lpncsp->rgrc[0].right-=m_nBorderPixels+m_nClientBorderPixels;
lpncsp->rgrc[0].bottom-=m_nBorderPixels+m_nClientBorderPixels;
}
- 最后在WM_NCPAINT消息里自画MDI边框