在CWinApp类的InitInstance()中添加如下代码

 RECT rc;
 ::GetWindowRect( m_pMainWnd->m_hWnd, &rc );
 ::SetWindowPos( m_pMainWnd->m_hWnd, HWND_TOP,
  ( GetSystemMetrics( SM_CXSCREEN ) - ( rc.right - rc.left ) ) / 2,
  ( GetSystemMetrics( SM_CYSCREEN ) - ( rc.bottom - rc.top ) ) / 2,
  rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW );

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
猜你喜欢
  • 2022-01-12
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案