| 85 | } |
| 86 | |
| 87 | CustomWindow::CustomWindow(Window* parent, const wchar_t* class_name, |
| 88 | const wchar_t* title) |
| 89 | : Window(parent, class_name, title) { |
| 90 | WNDCLASS wcx; |
| 91 | |
| 92 | wcx.style = CS_HREDRAW | CS_VREDRAW; |
| 93 | wcx.lpfnWndProc = WndProc; |
| 94 | wcx.cbClsExtra = 0; |
| 95 | wcx.cbWndExtra = 0; |
| 96 | wcx.hInstance = GetHInstance(); |
| 97 | wcx.hIcon = NULL; |
| 98 | wcx.hCursor = LoadCursor(NULL, IDC_ARROW); |
| 99 | wcx.hbrBackground = (HBRUSH)COLOR_WINDOW; |
| 100 | wcx.lpszMenuName = NULL; |
| 101 | wcx.lpszClassName = class_name; |
| 102 | |
| 103 | if (!RegisterClass(&wcx)) { |
| 104 | std::stringstream buf; |
| 105 | buf << "Can not register window class, error code: " << GetLastError(); |
| 106 | throw DriverException(buf.str()); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | CustomWindow::~CustomWindow() { UnregisterClass(class_name_.c_str(), GetHInstance()); } |
| 111 |
nothing calls this directly
no test coverage detected