diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7395bb3b66..2c27aa90f1 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11029,7 +11029,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0); - TRACE("(uMsg=%x wParam=%lx lParam=%lx)\n", uMsg, wParam, lParam); + TRACE("(hwnd=%p uMsg=%x wParam=%lx lParam=%lx)\n", hwnd, uMsg, wParam, lParam); if (!infoPtr && (uMsg != WM_NCCREATE)) return DefWindowProcW(hwnd, uMsg, wParam, lParam); @@ -11589,6 +11589,11 @@ void LISTVIEW_Unregister(void) */ static LRESULT LISTVIEW_Command(LISTVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { + + TRACE("(%p %x %x %lx)\n", infoPtr, HIWORD(wParam), LOWORD(wParam), lParam); + + if (!infoPtr->hwndEdit) return 0; + switch (HIWORD(wParam)) { case EN_UPDATE: diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 929583d34c..b116962175 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -3496,6 +3496,22 @@ static void test_editbox(void) r = SendMessage(hwnd, LVM_INSERTITEMA, 0, (LPARAM)&item); expect(0, r); + /* test notifications without edit created */ + flush_sequences(sequences, NUM_MSG_SEQUENCES); + r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)0xdeadbeef); + expect(0, r); + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, + "edit box WM_COMMAND (EN_SETFOCUS), no edit created", FALSE); + /* same thing but with valid window */ + hwndedit = CreateWindowA("Edit", "Test edit", WS_VISIBLE | WS_CHILD, 0, 0, 20, + 10, hwnd, (HMENU)1, (HINSTANCE)GetWindowLongPtrA(hwnd, GWLP_HINSTANCE), 0); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + r = SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0, EN_SETFOCUS), (LPARAM)hwndedit); + expect(0, r); + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, + "edit box WM_COMMAND (EN_SETFOCUS), no edit created #2", FALSE); + DestroyWindow(hwndedit); + /* setting focus is necessary */ SetFocus(hwnd); hwndedit = (HWND)SendMessage(hwnd, LVM_EDITLABEL, 0, 0);