Check for return value
@@ -166,12 +166,17 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
//wait for user to click launch button or close the window
while (true)
{
- MsgWaitForMultipleObjects(0, NULL, FALSE, INFINITE, QS_ALLINPUT);
+ switch (MsgWaitForMultipleObjects(0, NULL, FALSE, INFINITE, QS_ALLINPUT))
+ {
+ case WAIT_OBJECT_0:
MSG msg;
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+ {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
+ break;
+ }
}
}
break;
