From 4b292b0cb52c8a86a77999f5a0a77a6e704ff82c Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Mon, 13 Nov 2006 21:33:42 -0700 Subject: [PATCH] riched20: Fix key handling in dialogs. --- dlls/riched20/editor.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 07aa4e07803..779a6bc2429 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1465,8 +1465,20 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP case WM_GETDLGCODE: { UINT code = DLGC_WANTCHARS|DLGC_WANTARROWS; - if (GetWindowLongW(hWnd, GWL_STYLE)&ES_WANTRETURN) - code |= 0; /* FIXME what can we do here ? ask for messages and censor them ? */ + if(lParam && (((LPMSG)lParam)->message == WM_KEYDOWN)) + { + int vk = (int)((LPMSG)lParam)->wParam; + /* if style says we want return key */ + if((vk == VK_RETURN) && (GetWindowLongW(hWnd, GWL_STYLE) & ES_WANTRETURN)) + { + code |= DLGC_WANTMESSAGE; + } + /* we always handle ctrl-tab */ + if((vk == VK_TAB) && (GetKeyState(VK_CONTROL) & 0x8000)) + { + code |= DLGC_WANTMESSAGE; + } + } return code; } case WM_NCCREATE: