From e16e661417f5ba370ec77da9cb1858d3477ad780 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 18 Jun 2019 01:34:52 +0300 Subject: [PATCH] Use Get/SetWindowLongPtr Since sizeof(long) != sizeof(void *) on Windows, the non-Ptr versions do not work properly on 64-bit Windows. --- source/graphics/windows/window.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/graphics/windows/window.cpp b/source/graphics/windows/window.cpp index c07fbae..977efcd 100644 --- a/source/graphics/windows/window.cpp +++ b/source/graphics/windows/window.cpp @@ -14,11 +14,11 @@ LRESULT CALLBACK wndproc_(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) if(msg==WM_CREATE) { CREATESTRUCT *cs = reinterpret_cast(lparam); - SetWindowLong(hwnd, 0, reinterpret_cast(cs->lpCreateParams)); + SetWindowLongPtr(hwnd, 0, reinterpret_cast(cs->lpCreateParams)); } else { - Msp::Graphics::Window *wnd = reinterpret_cast(GetWindowLong(hwnd, 0)); + Msp::Graphics::Window *wnd = reinterpret_cast(GetWindowLongPtr(hwnd, 0)); Msp::Graphics::Window::Event ev; ev.msg = msg; ev.wparam = wparam; @@ -117,8 +117,8 @@ void Window::platform_reconfigure(bool fullscreen_changed) bool was_visible = visible; if(was_visible) hide(); - SetWindowLong(priv->window, GWL_EXSTYLE, exstyle); - SetWindowLong(priv->window, GWL_STYLE, style); + SetWindowLongPtr(priv->window, GWL_EXSTYLE, exstyle); + SetWindowLongPtr(priv->window, GWL_STYLE, style); if(was_visible) show(); } -- 2.45.2