Commit 5d708246 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Don't forward WM_COMMAND to parent if we don't have an Edit box.

parent c79aad51
......@@ -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:
......
......@@ -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);
......
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