我尝试这样的做法,但是这个最大化是全屏幕的,我想要的最大化是:
如果有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;
}

解决方案 »

  1.   

    不是有 ShowWindow(SW_MAXIMIZE);吗还用得着修改 cs
      

  2.   

    就是,,,ShowWindow(SW_MAXIMIZE);就可以了~~~~~~~~~~~~~~~
      

  3.   

    //文档应用程序启动时最消化/最大化
    首先将m_pMainWnd->ShowWindow(SW_SHOW);屏蔽
    然后:文档应用程序启动时最小消化
    在应用程序的APP类的InitInstance中添加代码:
    m_pMainWnd->ShowWindow(SW_MINIMIZE); 文档应用程序启动时最大消化
    在应用程序的APP类的InitInstance中添加代码:
    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);