diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 3b70e6c7e26..24a63d8af2a 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -206,7 +206,7 @@ static const struct message parent_expand_seq[] = { }; static const struct message parent_expand_kb_seq[] = { - { WM_NOTIFY, sent|id|optional, 0, 0, TVN_KEYDOWN }, + { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN }, { WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDINGA }, { WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDEDA }, { WM_CHANGEUISTATE, sent|optional }, @@ -221,7 +221,7 @@ static const struct message parent_collapse_2nd_kb_seq[] = { }; static const struct message parent_expand_empty_kb_seq[] = { - { WM_NOTIFY, sent|id|optional, 0, 0, TVN_KEYDOWN }, + { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN }, { WM_CHANGEUISTATE, sent|optional }, { 0 } }; diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index c26513fcbf8..40673234a2a 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -5201,11 +5201,15 @@ TREEVIEW_KeyDown(TREEVIEW_INFO *infoPtr, WPARAM wParam) { /* If it is non-NULL and different, it will be selected and visible. */ TREEVIEW_ITEM *newSelection = NULL; - TREEVIEW_ITEM *prevItem = infoPtr->selectedItem; + NMTVKEYDOWN nmkeydown; TRACE("%lx\n", wParam); + nmkeydown.wVKey = wParam; + nmkeydown.flags = 0; + TREEVIEW_SendRealNotify(infoPtr, TVN_KEYDOWN, &nmkeydown.hdr); + if (prevItem == NULL) return FALSE;