Module: wine Branch: master Commit: 0fac05b97791145cc624034733ab474169640156 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0fac05b97791145cc624034733...
Author: Lei Zhang thestig@google.com Date: Thu Mar 27 12:22:04 2008 -0700
user32: Handle WM_CHAR messages better in edit controls.
---
dlls/user32/edit.c | 22 ++++++++++++++++------ dlls/user32/tests/edit.c | 6 +++--- 2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 0ff4e7c..dd5ba0a 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -853,12 +853,22 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, MultiByteToWideChar(CP_ACP, 0, &charA, 1, &charW, 1); }
- if ((charW == VK_RETURN || charW == VK_ESCAPE) && es->hwndListBox) - { - if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0)) - SendMessageW(GetParent(hwnd), WM_KEYDOWN, charW, 0); - break; - } + if (es->hwndListBox) + { + if (charW == VK_RETURN || charW == VK_ESCAPE) + { + if (SendMessageW(GetParent(hwnd), CB_GETDROPPEDSTATE, 0, 0)) + { + SendMessageW(GetParent(hwnd), WM_KEYDOWN, charW, 0); + break; + } + } + } + else + { + if (charW == VK_TAB || charW == VK_RETURN) + break; + } EDIT_WM_Char(es, charW); break; } diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 0d15641..74092be 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1296,9 +1296,9 @@ static void test_edit_dialog(void) r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 3); ok(444 == r, "Expected %d, got %d\n", 444, r); r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 4); - todo_wine ok(444 == r, "Expected %d, got %d\n", 444, r); + ok(444 == r, "Expected %d, got %d\n", 444, r); r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 5); - todo_wine ok(444 == r, "Expected %d, got %d\n", 444, r); + ok(444 == r, "Expected %d, got %d\n", 444, r);
/* tests for WM_KEYDOWN + WM_CHAR */ r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 6); @@ -1306,7 +1306,7 @@ static void test_edit_dialog(void) r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 7); todo_wine ok(444 == r, "Expected %d, got %d\n", 444, r); r = DialogBoxParam(hinst, "EDIT_DIALOG", NULL, (DLGPROC)edit_dialog_proc, 8); - todo_wine ok(444 == r, "Expected %d, got %d\n", 444, r); + ok(444 == r, "Expected %d, got %d\n", 444, r); }
static BOOL RegisterWindowClasses (void)