diff --git a/src/kiwano/platform/win32/WindowImpl.cpp b/src/kiwano/platform/win32/WindowImpl.cpp index ced5351e..3246ce21 100644 --- a/src/kiwano/platform/win32/WindowImpl.cpp +++ b/src/kiwano/platform/win32/WindowImpl.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include // GET_X_LPARAM, GET_Y_LPARAM #include // ImmAssociateContext @@ -227,10 +228,14 @@ void WindowWin32Impl::Init(const String& title, uint32_t width, uint32_t height, wcex.hIcon = (HICON)::LoadImage(hinst, MAKEINTRESOURCE(icon.resource_id), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_DEFAULTSIZE); } - else if (!icon.file_path.empty()) + else { - wcex.hIcon = (HICON)::LoadImageA(NULL, icon.file_path.c_str(), IMAGE_ICON, 0, 0, - LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE); + String full_path = FileSystem::GetInstance().GetFullPathForFile(icon.file_path); + if (!full_path.empty()) + { + wcex.hIcon = (HICON)::LoadImageA(NULL, full_path.c_str(), IMAGE_ICON, 0, 0, + LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE); + } } ::RegisterClassExA(&wcex);