用微软的Spy++偷看photoshop设置的属性,具体就是这样的.
首先是设置CChildFrame的属性:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
//SetClassLong(this->m_hWnd,GCL_HICON,NULL);
cs.style |= WS_OVERLAPPEDWINDOW | WS_VISIBLE |
WS_CLIPCHILDREN | WS_CLIPSIBLINGS |WS_OVERLAPPED;
cs.dwExStyle = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_WINDOWEDGE;
return TRUE;
}
再设置CXXView的属性
BOOL CXXView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style = WS_CHILDWINDOW | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
WS_OVERLAPPED | WS_MINIMIZEBOX;
cs.dwExStyle = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR;
return CView::PreCreateWindow(cs);
}
这两个合起来的属性就有这样的效果了,不过我不知道是到底设置那个属性才有这样的效果的.附图
这是MFC默认的MDI子窗口,
其实在SDI程序中原理是一样的。
修改后的效果
标签:MDI,PreCreateWindow,扁平,MFC,WS,EX,cs,CREATESTRUCT,属性 From: https://blog.51cto.com/u_15911341/5934945