Fix enter/escape crashes on Windows (#202)

* Do not let slip through IDOK and IDCANCEL as menu events, fixes #55

* Add comment about IDOK and IDCANCEL
This commit is contained in:
Alexander Neumann 2018-02-17 18:53:32 +01:00 committed by Pietro Gagliardi
parent 5fa7ba487e
commit ee87a9db23
1 changed files with 2 additions and 1 deletions

View File

@ -87,7 +87,8 @@ static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
// not a menu
if (lParam != 0)
break;
if (HIWORD(wParam) != 0)
// IDOK (1) and IDCANCEL (2) aren't menu events either
if (HIWORD(wParam) != 0 || LOWORD(wParam) <= IDCANCEL)
break;
runMenuEvent(LOWORD(wParam), uiWindow(w));
return 0;