From a762b4ce2fc27e6dcb26dac394cae50b119b6a56 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Mon, 19 May 2003 21:40:31 +0000 Subject: [PATCH] Revert the WM_GETDLGCODE handling patch completely this time. It breaks too much. --- controls/edit.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index 7ce698b24ec..14e36294795 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -745,18 +745,21 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, case WM_GETDLGCODE: result = DLGC_HASSETSEL | DLGC_WANTCHARS | DLGC_WANTARROWS; - if( es->hwndListBox ) - { - if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN)) - { - int vk = (int)((LPMSG)lParam)->wParam; - if( vk == VK_RETURN || vk == VK_ESCAPE) - if( SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0)) - result |= DLGC_WANTMESSAGE; - } - } else - /* It seems in all other cases Windows has this set: */ - result |= DLGC_WANTMESSAGE; + + if (lParam && (((LPMSG)lParam)->message == WM_KEYDOWN)) + { + int vk = (int)((LPMSG)lParam)->wParam; + + if (vk == VK_RETURN && (GetWindowLongW( hwnd, GWL_STYLE ) & ES_WANTRETURN)) + { + result |= DLGC_WANTMESSAGE; + } + else if (es->hwndListBox && (vk == VK_RETURN || vk == VK_ESCAPE)) + { + if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0)) + result |= DLGC_WANTMESSAGE; + } + } break; case WM_IME_CHAR: