在App中我用m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);让程序启动时就最大化
然后我在CMainFrame::PreCreateWindow中用cs.style &= ~WS_MAXIMIZEBOX;禁用了最大化(还原)按钮,在窗口最大化时,状态栏消失了。如果去掉cs.style &= ~WS_MAXIMIZEBOX,状态栏又有了。
但我想禁用最大化(还原)按钮,哪位大虾指点一下。先谢了!

解决方案 »

  1.   

    如果真的不行的话你将m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);换为下面的语句试试:
    m_pMainWnd->ShowWindow(SW_SHOW); CRect rcWindow;
    m_pMainWnd->GetWindowRect(&rcWindow);
    int xSize = ::GetSystemMetrics (SM_CXSCREEN);
    int ySize = ::GetSystemMetrics (SM_CYSCREEN); int Width = rcWindow.Width();
    int Height = rcWindow.Height();

    rcWindow.left = (xSize- Width)/2;
    rcWindow.right = rcWindow.left + Width; rcWindow.top = (ySize - Height)/2;
    rcWindow.bottom = rcWindow.top + Height; m_pMainWnd->MoveWindow(&rcWindow);
      

  2.   

    是SDI工程,设置的是WIN32 Release
      

  3.   

    呵呵,一般绝对是没有问题的,我也做过测试了,也是SDI程序!