以下两种方法可任选其一:
①在应用程序类(CxxxApp)的 InitInstance() 函数中加入:
m_pMainWnd->CenterWindow( GetDesktopWindow() );
②在主框架类(MainFrm.cpp)的OnCreate()函数中加入:
CenterWindow( GetDesktopWindow() );
Example(3): Center Window(CWnd:: GetDesktopWindow( ));
//Relative to Application's MainWindow
AfxGetMainWnd( ) -> Center Window( );