From 6b616a0fd8f3ef29fbda46789ea62d148edc27e6 Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Tue, 8 Apr 2014 01:43:53 +0900 Subject: [PATCH] user32: Emit EM_SETSEL message when choosing "Select All" from context menu. --- dlls/user32/edit.c | 3 +-- dlls/user32/tests/edit.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 1a9796fca10..4b29f03d8ab 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -3266,8 +3266,7 @@ static void EDIT_ContextMenuCommand(EDITSTATE *es, UINT id) SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0); break; case EM_SETSEL: - EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE); - EDIT_EM_ScrollCaret(es); + SendMessageW(es->hwndSelf, EM_SETSEL, 0, -1); break; default: ERR("unknown menu item, please report\n"); diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 312e419b2a2..e5c05db574b 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -2325,7 +2325,7 @@ static void test_contextmenu(void) while (PeekMessageA(&msg, hwndEdit, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); ok(menu_messages.wm_command == 0, "Expected no WM_COMMAND messages, got %d\n", menu_messages.wm_command); - todo_wine ok(menu_messages.em_setsel == 1, + ok(menu_messages.em_setsel == 1, "Expected 1 EM_SETSEL message, got %d\n", menu_messages.em_setsel); DestroyWindow (hwndEdit);