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

This commit is contained in:
Nikolay Sivov 2010-05-20 23:22:10 +04:00 committed by Alexandre Julliard
parent c79aad51cd
commit 5d708246d7
2 changed files with 22 additions and 1 deletions

View File

@ -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:

View File

@ -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);