Commit d4707dbb authored by Sergey Khodych's avatar Sergey Khodych Committed by Alexandre Julliard

user32: edit: Improve handling of WM_KEYDOWN VK_TAB in a dialog mode.

parent 3b6ea114
......@@ -3641,7 +3641,8 @@ static LRESULT EDIT_WM_KeyDown(EDITSTATE *es, INT key)
PostMessageW(es->hwndParent, WM_CLOSE, 0, 0);
break;
case VK_TAB:
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
if ((es->style & ES_MULTILINE) && EDIT_IsInsideDialog(es))
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
break;
}
return TRUE;
......
......@@ -2192,12 +2192,36 @@ static void test_dialogmode(void)
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.hwnd = hwEdit;
msg.message = WM_KEYDOWN;
msg.wParam = VK_TAB;
msg.lParam = 0xf0001;
r = SendMessage(hwEdit, WM_GETDLGCODE, VK_TAB, (LPARAM)&msg);
ok(0x89 == r, "expected 0x89, got 0x%x\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
destroy_child_editcontrol(hwEdit);
hwEdit = create_child_editcontrol(ES_MULTILINE, 0);
hwParent = GetParent(hwEdit);
SetWindowLongPtr(hwParent, GWLP_WNDPROC, (LONG_PTR)dialog_mode_wnd_proc);
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
msg.hwnd = hwEdit;
msg.message = WM_KEYDOWN;
msg.wParam = VK_ESCAPE;
......@@ -2212,6 +2236,11 @@ static void test_dialogmode(void)
test_dm_messages(0, 0, 0, 0);
zero_dm_messages();
r = SendMessage(hwEdit, WM_KEYDOWN, VK_TAB, 0xf0001);
ok(1 == r, "expected 1, got %d\n", r);
test_dm_messages(0, 0, 0, 1);
zero_dm_messages();
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