Use SetClassLongPtr compatible for both Windows x86 and x64

This commit is contained in:
Prcuvu
2019-10-01 14:14:38 +08:00
parent e5321deed4
commit 4f864911fc
2 changed files with 3 additions and 4 deletions
@@ -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 )
+2 -2
View File
@@ -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. */