| 29 | } |
| 30 | |
| 31 | WindowClass::WindowClass(WNDPROC procedure, Util::null_terminated_wstring_view className, const wchar_t *iconResource, HINSTANCE hInstance, unsigned int style, HBRUSH brush, HCURSOR cursor) : |
| 32 | m_hInstance(hInstance) |
| 33 | { |
| 34 | LoadIcons(iconResource); |
| 35 | |
| 36 | const WNDCLASSEX classStruct = { |
| 37 | .cbSize = sizeof(classStruct), |
| 38 | .style = style, |
| 39 | .lpfnWndProc = procedure, |
| 40 | .hInstance = hInstance, |
| 41 | .hIcon = m_hIcon.get(), |
| 42 | .hCursor = cursor, |
| 43 | .hbrBackground = brush, |
| 44 | .lpszClassName = className.c_str(), |
| 45 | .hIconSm = m_hIconSmall.get() |
| 46 | }; |
| 47 | |
| 48 | m_Atom = RegisterClassEx(&classStruct); |
| 49 | if (!m_Atom) |
| 50 | { |
| 51 | LastErrorHandle(spdlog::level::critical, L"Failed to register window class!"); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | void WindowClass::ChangeIcon(Window window, const wchar_t *iconResource) |
| 56 | { |