Skip to content

Commit

Permalink
Fixed funcs for safe use in Win32/Win64
Browse files Browse the repository at this point in the history
Signed-off-by: GermanAizek <GermanAizek@yandex.ru>
  • Loading branch information
GermanAizek committed Aug 15, 2021
1 parent a262636 commit 57150e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SFML/Window/Win32/WindowImplWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void WindowImplWin32::setSize(const Vector2u& size)
// SetWindowPos wants the total size of the window (including title bar and borders),
// so we have to compute it
RECT rectangle = {0, 0, static_cast<long>(size.x), static_cast<long>(size.y)};
AdjustWindowRect(&rectangle, GetWindowLong(m_handle, GWL_STYLE), false);
AdjustWindowRect(&rectangle, GetWindowLongPtr(m_handle, GWL_STYLE), false);
int width = rectangle.right - rectangle.left;
int height = rectangle.bottom - rectangle.top;

Expand Down Expand Up @@ -496,8 +496,8 @@ void WindowImplWin32::switchToFullscreen(const VideoMode& mode)
}

// Make the window flags compatible with fullscreen mode
SetWindowLongW(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowLongW(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW);
SetWindowLongPtr(m_handle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowLongPtr(m_handle, GWL_EXSTYLE, WS_EX_APPWINDOW);

// Resize the window so that it fits the entire screen
SetWindowPos(m_handle, HWND_TOP, 0, 0, mode.width, mode.height, SWP_FRAMECHANGED);
Expand Down

0 comments on commit 57150e3

Please sign in to comment.