关于SDI窗口最大化的问题,请指点
我尝试这样的做法,但是这个最大化是全屏幕的,我想要的最大化是:
如果有windows的工具栏存在即显示工具栏以上的最大化,如果工具栏隐藏则显示全屏幕的最大化,大家有什么方法吗?
注明:windows工具栏就是“开始”工具栏
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
int nScreenX, nScreenY;
//Get width and height of current screen.
nScreenX = GetSystemMetrics(SM_CXSCREEN);
nScreenY = GetSystemMetrics(SM_CYSCREEN);
//Set size of CREATESTRUCT structure.
cs.cx = nScreenX;
cs.cy = nScreenY;
//Set style of Wnd, it means no Max button on the window.
cs.style &= ~WS_MAXIMIZEBOX;
return TRUE;
}