| 53 | } |
| 54 | |
| 55 | void WindowClass::ChangeIcon(Window window, const wchar_t *iconResource) |
| 56 | { |
| 57 | const auto guard = m_Lock.lock_exclusive(); |
| 58 | LoadIcons(iconResource); |
| 59 | |
| 60 | SetLastError(NO_ERROR); |
| 61 | if (!SetClassLongPtr(window, GCLP_HICON, reinterpret_cast<LONG_PTR>(m_hIcon.get()))) |
| 62 | { |
| 63 | LastErrorVerify(spdlog::level::warn, L"Failed to change large window class icon."); |
| 64 | } |
| 65 | |
| 66 | SetLastError(NO_ERROR); |
| 67 | if (!SetClassLongPtr(window, GCLP_HICONSM, reinterpret_cast<LONG_PTR>(m_hIconSmall.get()))) |
| 68 | { |
| 69 | LastErrorVerify(spdlog::level::warn, L"Failed to change small window class icon."); |
| 70 | } |
| 71 | } |