From 4f864911fcfa587b4772af4f48cc1cb72e6c6ea9 Mon Sep 17 00:00:00 2001 From: Prcuvu Date: Tue, 1 Oct 2019 14:14:38 +0800 Subject: [PATCH] Use SetClassLongPtr compatible for both Windows x86 and x64 --- src/arch/LoadingWindow/LoadingWindow_Win32.cpp | 3 +-- src/archutils/Win32/GraphicsWindow.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp index d6270af258..fdc40c0155 100644 --- a/src/arch/LoadingWindow/LoadingWindow_Win32.cpp +++ b/src/arch/LoadingWindow/LoadingWindow_Win32.cpp @@ -118,8 +118,7 @@ void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon ) m_hIcon = IconFromSurface( pIcon ); if( m_hIcon != nullptr ) - // XXX: GCL_HICON isn't available on x86-64 Windows - SetClassLong( hwnd, GCL_HICON, (LONG) m_hIcon ); + SetClassLongPtrA( hwnd, GCLP_HICON, (LONG) m_hIcon ); } void LoadingWindow_Win32::SetSplash( const RageSurface *pSplash ) diff --git a/src/archutils/Win32/GraphicsWindow.cpp b/src/archutils/Win32/GraphicsWindow.cpp index ea8bf10210..b370c8b0f6 100644 --- a/src/archutils/Win32/GraphicsWindow.cpp +++ b/src/archutils/Win32/GraphicsWindow.cpp @@ -321,13 +321,13 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce // Update the window icon. if( g_hIcon != nullptr ) { - SetClassLong( g_hWndMain, GCL_HICON, (LONG) LoadIcon(nullptr,IDI_APPLICATION) ); + SetClassLongPtrA( g_hWndMain, GCLP_HICON, (LONG) LoadIcon(nullptr,IDI_APPLICATION) ); DestroyIcon( g_hIcon ); g_hIcon = nullptr; } g_hIcon = IconFromFile( p.sIconFile ); if( g_hIcon != nullptr ) - SetClassLong( g_hWndMain, GCL_HICON, (LONG) g_hIcon ); + SetClassLongPtrA( g_hWndMain, GCLP_HICON, (LONG) g_hIcon ); /* The window style may change as a result of switching to or from fullscreen; * apply it. Don't change the WS_VISIBLE bit. */