Commit 861fb2ed authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/treeview: Handle EN_KILLFOCUS in WM_COMMAND handler.

parent 578e872b
......@@ -875,7 +875,7 @@ static void test_itemedit(void)
r = SendMessage(hTree, WM_COMMAND, MAKEWPARAM(0, EN_KILLFOCUS), (LPARAM)edit);
expect(0, r);
todo_wine ok(!IsWindow(edit), "Expected edit control to be destroyed\n");
ok(!IsWindow(edit), "Expected edit control to be destroyed\n");
DestroyWindow(hTree);
}
......
......@@ -3637,6 +3637,9 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
ReleaseDC(infoPtr->hwnd, hdc);
break;
}
case EN_KILLFOCUS:
TREEVIEW_EndEditLabelNow(infoPtr, FALSE);
break;
default:
return SendMessageW(infoPtr->hwndNotify, WM_COMMAND, wParam, lParam);
......@@ -3757,8 +3760,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
WCHAR *newText = tmpText;
int iLength = 0;
if (!infoPtr->hwndEdit)
return FALSE;
if (!IsWindow(infoPtr->hwndEdit)) return FALSE;
tvdi.hdr.hwndFrom = hwnd;
tvdi.hdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID);
......
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