| 675 | struct WindowClass |
| 676 | { |
| 677 | WindowClass (std::wstring name, WNDPROC wndProc) |
| 678 | { |
| 679 | name += std::to_wstring (static_cast<uint32_t> (GetTickCount())); |
| 680 | |
| 681 | moduleHandle = GetModuleHandle (nullptr); |
| 682 | auto icon = (HICON) LoadImage (moduleHandle, IDI_APPLICATION, IMAGE_ICON, |
| 683 | GetSystemMetrics (SM_CXSMICON), |
| 684 | GetSystemMetrics (SM_CYSMICON), |
| 685 | LR_DEFAULTCOLOR); |
| 686 | |
| 687 | WNDCLASSEXW wc; |
| 688 | ZeroMemory (&wc, sizeof(wc)); |
| 689 | wc.cbSize = sizeof(wc); |
| 690 | wc.style = CS_OWNDC; |
| 691 | wc.hInstance = moduleHandle; |
| 692 | wc.lpszClassName = name.c_str(); |
| 693 | wc.hIcon = icon; |
| 694 | wc.hIconSm = icon; |
| 695 | wc.lpfnWndProc = wndProc; |
| 696 | |
| 697 | classAtom = (LPCWSTR) (uintptr_t) RegisterClassExW (&wc); |
| 698 | CHOC_ASSERT (classAtom != 0); |
| 699 | } |
| 700 | |
| 701 | ~WindowClass() |
| 702 | { |
nothing calls this directly
no outgoing calls
no test coverage detected