diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 7238bd0d46e..5088d91ac69 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -1359,10 +1359,8 @@ static void test_delete_items(void) if (item_sequence[0]->count == 2) { -todo_wine { - ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got %lx\n", hChild, msg[0].lParam); - ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got %lx\n", hRoot, msg[1].lParam); -} + ok(msg[0].lParam == (LPARAM)hChild, "expected %p, got 0x%lx\n", hChild, msg[0].lParam); + ok(msg[1].lParam == (LPARAM)hRoot, "expected %p, got 0x%lx\n", hRoot, msg[1].lParam); } ret = SendMessageA(hTree, TVM_GETCOUNT, 0, 0); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 1ca5639431a..f8c28de2f13 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -1479,12 +1479,12 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem) { TRACE("%p, (%s)\n", wineItem, TREEVIEW_ItemName(wineItem)); - TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, - TVIF_HANDLE | TVIF_PARAM, wineItem, 0); - if (wineItem->firstChild) TREEVIEW_RemoveAllChildren(infoPtr, wineItem); + TREEVIEW_SendTreeviewNotify(infoPtr, TVN_DELETEITEMW, TVC_UNKNOWN, + TVIF_HANDLE | TVIF_PARAM, wineItem, 0); + TREEVIEW_UnlinkItem(wineItem); infoPtr->uNumItems--;