Nikolay Sivov : comctl32/listview: Don't forward WM_COMMAND (EN_KILLFOCUS) from Edit to parent window.

Alexandre Julliard julliard at winehq.org
Mon Nov 23 08:49:52 CST 2009


Module: wine
Branch: master
Commit: f5f076382770b6dd5d39b0c356d4f8a797c361b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f5f076382770b6dd5d39b0c356d4f8a797c361b7

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Sat Nov 21 12:23:05 2009 +0300

comctl32/listview: Don't forward WM_COMMAND (EN_KILLFOCUS) from Edit to parent window.

---

 dlls/comctl32/listview.c       |    1 +
 dlls/comctl32/tests/listview.c |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 594db6e..40804b5 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -11409,6 +11409,7 @@ static LRESULT LISTVIEW_Command(LISTVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lP
 	case EN_KILLFOCUS:
 	{
 	    LISTVIEW_CancelEditLabel(infoPtr);
+	    break;
 	}
 
 	default:
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 6b3ebff..99c25da 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -271,6 +271,13 @@ static const struct message lvs_ex_transparentbkgnd_seq[] = {
     { 0 }
 };
 
+static const struct message edit_end_nochange[] = {
+    { WM_NOTIFY, sent|id, 0, 0, LVN_ENDLABELEDITA }, /* todo */
+    { WM_NOTIFY, sent|id, 0, 0, NM_CUSTOMDRAW },     /* todo */
+    { WM_NOTIFY, sent|id, 0, 0, NM_SETFOCUS },
+    { 0 }
+};
+
 static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     static LONG defwndproc_counter = 0;
@@ -3473,6 +3480,16 @@ static void test_editbox(void)
     ok_sequence(sequences, EDITBOX_SEQ_INDEX, editbox_create_pos,
                 "edit box create - sizing", FALSE);
 
+    /* WM_COMMAND with EN_KILLFOCUS isn't forwared to parent */
+    SetFocus(hwnd);
+    hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0);
+    ok(IsWindow(hwndedit), "Expected Edit window to be created\n");
+    flush_sequences(sequences, NUM_MSG_SEQUENCES);
+    r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)hwndedit);
+    expect(0, r);
+    ok_sequence(sequences, PARENT_SEQ_INDEX, edit_end_nochange,
+                "edit box WM_COMMAND (EN_KILLFOCUS)", TRUE);
+
     DestroyWindow(hwnd);
 }
 




More information about the wine-cvs mailing list