如何使应用程序窗口居中?如何使窗口不能被用户移动位置?

解决方案 »

  1.   

    CenterWindow()
    处理OnNCHitTest()
      

  2.   

    Easy, Call Function CWnd:: Center Windows   Example(1):  CenterWindow();  //Relative to it's parent
              // Relative to Screen
             Example(2):  CenterWindow(CWnd:: GetDesktopWindow( ));
              //Relative to Application's MainWindow
             AfxGetMainWnd()->CenterWindow();
      

  3.   

    //窗口居中
    CenterWindow();使窗口不能被用户移动位置去掉状态条,他就没的移了
      

  4.   

    使窗体不能被移动
    CMenu *menu = this->GetSystemMenu(FALSE);
    menu->RemoveMenu(1, MF_BYPOSITION);居中窗体就如各楼上说的 CenterWindow