FUNCTION: InitInstance(HINSTANCE, int) PURPOSE: Saves instance handle and creates main window COMMENTS: In this function, we save the instance handle in a global variable and create and display the main program window.
| 207 | // create and display the main program window. |
| 208 | // |
| 209 | BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) |
| 210 | { |
| 211 | hInst = hInstance; // Store instance handle in our global variable |
| 212 | HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, |
| 213 | CW_USEDEFAULT, CW_USEDEFAULT, TEST_WIDTH, TEST_HEIGHT, nullptr, nullptr, hInstance, nullptr); |
| 214 | |
| 215 | if (!hWnd) |
| 216 | { |
| 217 | return FALSE; |
| 218 | } |
| 219 | |
| 220 | ShowWindow(hWnd, nCmdShow); |
| 221 | UpdateWindow(hWnd); |
| 222 | Initialize(hWnd); |
| 223 | |
| 224 | return TRUE; |
| 225 | } |
| 226 | |
| 227 | // |
| 228 | // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) |
no test coverage detected