[PATCH 2/2] programs/regedit: Clear value list when tree root is selected

Nikolay Sivov nsivov at codeweavers.com
Sat Jan 28 07:37:52 CST 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 programs/regedit/childwnd.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 08eeec1cbf..2211d6898d 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);
-- 
2.11.0




More information about the wine-patches mailing list