diff options
Diffstat (limited to 'src/gui/windowmanager.cpp')
-rw-r--r-- | src/gui/windowmanager.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index 79e6cb47c..346013639 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -434,6 +434,7 @@ void WindowManager::setIcon() SDL::getWindowWMInfo(mainGraphics->getWindow(), &pInfo); else SDL::getWindowWMInfo(nullptr, &pInfo); + // Attempt to load icon from .ico file HICON icon = static_cast<HICON>(LoadImage(nullptr, iconFile.c_str(), @@ -446,6 +447,7 @@ void WindowManager::setIcon() logger->log("icon load error"); icon = LoadIcon(GetModuleHandle(nullptr), "A"); } + if (icon) { #ifdef WIN64 @@ -454,16 +456,16 @@ void WindowManager::setIcon() #else SetClassLongPtr(pInfo.window, #endif // USE_SDL2 - GCLP_HICON, - reinterpret_cast<LONG_PTR>(icon)); + GCLP_HICON, + reinterpret_cast<LONG_PTR>(icon)); #else // WIN64 #ifdef USE_SDL2 SetClassLong(pInfo.info.win.window, #else SetClassLong(pInfo.window, #endif // USE_SDL2 - GCL_HICON, - reinterpret_cast<LONG>(icon)); + GCL_HICON, + reinterpret_cast<LONG>(icon)); #endif // WIN64 } #else // WIN32 |