@@ -744,10 +744,10 @@ void CHW::updateWindowProps(HWND m_hWnd)
744744 // Set window properties depending on what mode were in.
745745 if (bWindowed) {
746746 if (m_move_window) {
747- if ( strstr (Core. Params , " -no_dialog_header " ))
748- SetWindowLong ( m_hWnd, GWL_STYLE, dwWindowStyle=(WS_BORDER|WS_VISIBLE) );
749- else
750- SetWindowLong ( m_hWnd, GWL_STYLE, dwWindowStyle=(WS_BORDER|WS_DLGFRAME|WS_VISIBLE|WS_SYSMENU|WS_MINIMIZEBOX ) );
747+ dwWindowStyle = WS_BORDER | WS_VISIBLE;
748+ if (! strstr (Core. Params , " -no_dialog_header " ))
749+ dwWindowStyle |= WS_DLGFRAME | WS_SYSMENU | WS_MINIMIZEBOX;
750+ SetWindowLong ( m_hWnd, GWL_STYLE, dwWindowStyle);
751751 // When moving from fullscreen to windowed mode, it is important to
752752 // adjust the window size after recreating the device rather than
753753 // beforehand to ensure that you get the window size you want. For
@@ -758,33 +758,22 @@ void CHW::updateWindowProps(HWND m_hWnd)
758758 // desktop.
759759
760760 RECT m_rcWindowBounds;
761- BOOL bCenter = FALSE ;
762- if (strstr (Core.Params , " -center_screen" )) bCenter = TRUE ;
763-
764- if (bCenter) {
765- RECT DesktopRect;
766-
767- GetClientRect (GetDesktopWindow (), &DesktopRect);
768-
769- SetRect ( &m_rcWindowBounds,
770- (DesktopRect.right -m_ChainDesc.BufferDesc .Width )/2 ,
771- (DesktopRect.bottom -m_ChainDesc.BufferDesc .Height )/2 ,
772- (DesktopRect.right +m_ChainDesc.BufferDesc .Width )/2 ,
773- (DesktopRect.bottom +m_ChainDesc.BufferDesc .Height )/2 );
774- }else {
775- SetRect ( &m_rcWindowBounds,
776- 0 ,
777- 0 ,
778- m_ChainDesc.BufferDesc .Width ,
779- m_ChainDesc.BufferDesc .Height );
780- };
761+ RECT DesktopRect;
762+
763+ GetClientRect (GetDesktopWindow (), &DesktopRect);
764+
765+ SetRect ( &m_rcWindowBounds,
766+ (DesktopRect.right -m_ChainDesc.BufferDesc .Width )/2 ,
767+ (DesktopRect.bottom -m_ChainDesc.BufferDesc .Height )/2 ,
768+ (DesktopRect.right +m_ChainDesc.BufferDesc .Width )/2 ,
769+ (DesktopRect.bottom +m_ChainDesc.BufferDesc .Height )/2 );
781770
782771 AdjustWindowRect ( &m_rcWindowBounds, dwWindowStyle, FALSE );
783772
784773 SetWindowPos ( m_hWnd,
785774 HWND_NOTOPMOST,
786- m_rcWindowBounds.left ,
787- m_rcWindowBounds.top ,
775+ m_rcWindowBounds.left ,
776+ m_rcWindowBounds.top ,
788777 ( m_rcWindowBounds.right - m_rcWindowBounds.left ),
789778 ( m_rcWindowBounds.bottom - m_rcWindowBounds.top ),
790779 SWP_SHOWWINDOW|SWP_NOCOPYBITS|SWP_DRAWFRAME );
0 commit comments