diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index 06dab532290..dd63ba72a87 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -309,6 +309,15 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath) LPCWSTR keyPath, rootName; LPWSTR fullPath; + /* Wipe the listview, the status bar and the address bar if the root key was selected */ + if (TreeView_GetParent(g_pChildWnd->hTreeWnd, hItem) == NULL) + { + (void)ListView_DeleteAllItems(g_pChildWnd->hListWnd); + SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL); + SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL); + return; + } + if (pszPath == NULL) keyPath = GetItemPath(g_pChildWnd->hTreeWnd, hItem, &hRootKey); else @@ -348,12 +357,6 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath) } } } - else - { - (void)ListView_DeleteAllItems(g_pChildWnd->hListWnd); - SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)NULL); - SendMessageW(g_pChildWnd->hAddressBarWnd, WM_SETTEXT, 0, (LPARAM)NULL); - } } /*******************************************************************************