avoid using ListView_SetItemCountEx - fixes tooltips disappearing when process tree is being sorted

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@3688 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2010-09-28 22:28:49 +00:00
parent c2ea123848
commit ee0a9772cd
+8 -1
View File
@@ -1700,12 +1700,15 @@ static VOID PhpRestructureNodes(
PPH_TREELIST_NODE *children;
ULONG numberOfChildren;
ULONG i;
ULONG oldCount;
if (!PhpGetNodeChildren(Context, NULL, &children, &numberOfChildren))
return;
// At this point we rebuild the entire list.
oldCount = Context->List->Count;
PhClearList(Context->List);
Context->CanAnyExpand = FALSE;
@@ -1714,7 +1717,11 @@ static VOID PhpRestructureNodes(
PhpInsertNodeChildren(Context, children[i], 0);
}
ListView_SetItemCountEx(Context->ListViewHandle, Context->List->Count, LVSICF_NOSCROLL);
// Avoid using ListView_SetItemCountEx if we can.
if (Context->List->Count != oldCount)
ListView_SetItemCountEx(Context->ListViewHandle, Context->List->Count, LVSICF_NOINVALIDATEALL | LVSICF_NOSCROLL);
else
InvalidateRect(Context->ListViewHandle, NULL, TRUE);
}
static INT PhpInsertColumn(