Index: screensaver.c =================================================================== --- screensaver.c (revision 68398) +++ screensaver.c (working copy) @@ -161,24 +161,21 @@ FALSE, INFINITE, QS_ALLINPUT); + if (dwResult == WAIT_OBJECT_0 + 1) { - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) { return FALSE; } - if (IsDialogMessage(hwndDlg, &msg)) + if (!IsDialogMessage(hwndDlg, &msg)) //if true, msg already translated and dispatched { TranslateMessage(&msg); DispatchMessage(&msg); } } - else - { - return FALSE; - } } else if (dwResult == WAIT_OBJECT_0) {