From 6c85f39584801c782275fb387ef360e86fb4159f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 17 Feb 2018 12:56:47 -0500 Subject: [PATCH] Improved the comment in the previous commit. --- windows/window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/window.cpp b/windows/window.cpp index fbec558b..34baf545 100644 --- a/windows/window.cpp +++ b/windows/window.cpp @@ -87,7 +87,9 @@ static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA // not a menu if (lParam != 0) break; - // IDOK (1) and IDCANCEL (2) aren't menu events either + // IsDialogMessage() will also generate IDOK and IDCANCEL when pressing Enter and Escape (respectively) on some controls, like EDIT controls + // swallow those too; they'll cause runMenuEvent() to panic + // TODO fix the root cause somehow if (HIWORD(wParam) != 0 || LOWORD(wParam) <= IDCANCEL) break; runMenuEvent(LOWORD(wParam), uiWindow(w));