我写的一个多文档软件,打开两个窗口时,打开其中一个窗口时,出现图所示的情况,无最大化按钮,关闭按钮,但是我在CChildFrame的precreatewindow函数中已经修改了style。下面是代码,希望大神们指点指点,感激不尽啊!
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if(theApp.bSizeFixed)
{
cs.style = WS_CHILD | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU
| FWS_ADDTOTITLE|WS_MAXIMIZE|WS_MAXIMIZEBOX; ;//|WS_VISIBLE | 防止闪
}
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
initstance函数中
pDocTemplate = new CMultiDocTemplate(
IDR_GYFXYDATATYPE,
RUNTIME_CLASS(CGyfxDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CGyfxDataView));
AddDocTemplate(pDocTemplate);
用spy++看下窗口风格有没有应用上去。