Commit 2f0b1112 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

user32: Handle VK_RETURN WM_KEYDOWN events better in edit controls.

Elias Benali wrote the initial version of this patch.
parent 1e5faee2
...@@ -4602,8 +4602,12 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key) ...@@ -4602,8 +4602,12 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
/* If the edit doesn't want the return send a message to the default object */ /* If the edit doesn't want the return send a message to the default object */
if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN)) if(!(es->style & ES_MULTILINE) || !(es->style & ES_WANTRETURN))
{ {
HWND hwndParent = GetParent(es->hwndSelf); HWND hwndParent;
DWORD dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 ); DWORD dw;
if (!EDIT_IsInsideDialog(es)) return 1;
hwndParent = GetParent(es->hwndSelf);
dw = SendMessageW( hwndParent, DM_GETDEFID, 0, 0 );
if (HIWORD(dw) == DC_HASDEFID) if (HIWORD(dw) == DC_HASDEFID)
{ {
SendMessageW( hwndParent, WM_COMMAND, SendMessageW( hwndParent, WM_COMMAND,
......
...@@ -1932,8 +1932,8 @@ static void test_child_edit_wmkeydown(void) ...@@ -1932,8 +1932,8 @@ static void test_child_edit_wmkeydown(void)
hwParent = GetParent(hwEdit); hwParent = GetParent(hwEdit);
SetWindowLong(hwParent, GWL_WNDPROC, (LONG)child_edit_wmkeydown_proc); SetWindowLong(hwParent, GWL_WNDPROC, (LONG)child_edit_wmkeydown_proc);
r = SendMessage(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001); r = SendMessage(hwEdit, WM_KEYDOWN, VK_RETURN, 0x1c0001);
todo_wine ok(1 == r, "expected 1, got %d\n", r); ok(1 == r, "expected 1, got %d\n", r);
todo_wine ok(0 == child_edit_wmkeydown_num_messages, "expected 0, got %d\n", child_edit_wmkeydown_num_messages); ok(0 == child_edit_wmkeydown_num_messages, "expected 0, got %d\n", child_edit_wmkeydown_num_messages);
destroy_child_editcontrol(hwEdit); destroy_child_editcontrol(hwEdit);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment