From c5f26bf56ddbf314374825fae9f66b6def582a2e Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 28 Jan 2017 16:37:52 +0300 Subject: [PATCH] regedit: Clear value list when tree root is selected. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- programs/regedit/childwnd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c index 08eeec1cbf6..2211d6898da 100644 --- a/programs/regedit/childwnd.c +++ b/programs/regedit/childwnd.c @@ -174,6 +174,15 @@ static void OnTreeSelectionChanged(HWND hwndTV, HWND hwndLV, HTREEITEM hItem, BO if (bRefreshLV) { LPWSTR keyPath; HKEY hRootKey = NULL; + HTREEITEM rootitem; + + rootitem = (HTREEITEM)SendMessageW(hwndTV, TVM_GETNEXTITEM, TVGN_ROOT, 0); + if (rootitem == hItem) + { + SendMessageW(hwndLV, LVM_DELETEALLITEMS, 0, 0); + return; + } + keyPath = GetItemPath(hwndTV, hItem, &hRootKey); RefreshListView(hwndLV, hRootKey, keyPath, NULL); HeapFree(GetProcessHeap(), 0, keyPath);