MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / ChangeIcon

Method ChangeIcon

TranslucentTB/windows/windowclass.cpp:55–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void 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}

Callers 1

MessageHandlerMethod · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected