mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:25:58 +00:00
Changes to regedit:
* Fixed updating tree view when renaming a key * Fixed a tree view refresh bug * Proper updating of the tree view when deleting keys svn path=/trunk/; revision=29309
This commit is contained in:
parent
67dadefc81
commit
1a98d2a214
3 changed files with 18 additions and 13 deletions
|
@ -522,7 +522,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
HKEY hRootKey;
|
HKEY hRootKey;
|
||||||
HKEY hKey = NULL;
|
HKEY hKey = NULL;
|
||||||
LPNMTVDISPINFO ptvdi;
|
LPNMTVDISPINFO ptvdi;
|
||||||
LONG lResult = ERROR_SUCCESS;
|
LONG lResult = TRUE;
|
||||||
TCHAR szBuffer[MAX_PATH];
|
TCHAR szBuffer[MAX_PATH];
|
||||||
|
|
||||||
ptvdi = (LPNMTVDISPINFO) lParam;
|
ptvdi = (LPNMTVDISPINFO) lParam;
|
||||||
|
@ -533,13 +533,14 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||||
keyPath = GetItemPath(pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
|
keyPath = GetItemPath(pChildWnd->hTreeWnd, ptvdi->item.hItem, &hRootKey);
|
||||||
if (RegOpenKeyEx(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
if (RegOpenKeyEx(hRootKey, szBuffer, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
lResult = REG_OPENED_EXISTING_KEY;
|
lResult = FALSE;
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
(void)TreeView_EditLabel(pChildWnd->hTreeWnd, ptvdi->item.hItem);
|
(void)TreeView_EditLabel(pChildWnd->hTreeWnd, ptvdi->item.hItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lResult = RegRenameKey(hRootKey, keyPath, ptvdi->item.pszText);
|
if (RegRenameKey(hRootKey, keyPath, ptvdi->item.pszText) != ERROR_SUCCESS)
|
||||||
|
lResult = FALSE;
|
||||||
}
|
}
|
||||||
return lResult;
|
return lResult;
|
||||||
}
|
}
|
||||||
|
|
|
@ -949,7 +949,10 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
MessageBeep(MB_ICONHAND);
|
MessageBeep(MB_ICONHAND);
|
||||||
} else
|
} else
|
||||||
if (DeleteKey(hWnd, hKeyRoot, keyPath))
|
if (DeleteKey(hWnd, hKeyRoot, keyPath))
|
||||||
|
{
|
||||||
DeleteNode(g_pChildWnd->hTreeWnd, 0);
|
DeleteNode(g_pChildWnd->hTreeWnd, 0);
|
||||||
|
RefreshTreeView(g_pChildWnd->hTreeWnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ID_EDIT_NEW_STRINGVALUE:
|
case ID_EDIT_NEW_STRINGVALUE:
|
||||||
|
|
|
@ -218,6 +218,16 @@ BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
||||||
pszNodes[dwActualSize] = '\0';
|
pszNodes[dwActualSize] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Now go through all the children in the tree, and check if any have to be removed. */
|
||||||
|
childItem = TreeView_GetChild(hwndTV, hItem);
|
||||||
|
while (childItem) {
|
||||||
|
HTREEITEM nextItem = TreeView_GetNextSibling(hwndTV, childItem);
|
||||||
|
if (RefreshTreeItem(hwndTV, childItem) == FALSE) {
|
||||||
|
(void)TreeView_DeleteItem(hwndTV, childItem);
|
||||||
|
}
|
||||||
|
childItem = nextItem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now go through all the children in the registry, and check if any have to be added. */
|
/* Now go through all the children in the registry, and check if any have to be added. */
|
||||||
bAddedAny = FALSE;
|
bAddedAny = FALSE;
|
||||||
for (dwIndex = 0; dwIndex < dwCount; dwIndex++) {
|
for (dwIndex = 0; dwIndex < dwCount; dwIndex++) {
|
||||||
|
@ -258,15 +268,6 @@ BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
|
||||||
if (bAddedAny)
|
if (bAddedAny)
|
||||||
SendMessage(hwndTV, TVM_SORTCHILDREN, 0, (LPARAM) hItem);
|
SendMessage(hwndTV, TVM_SORTCHILDREN, 0, (LPARAM) hItem);
|
||||||
|
|
||||||
/* Now go through all the children in the tree, and check if any have to be removed. */
|
|
||||||
childItem = TreeView_GetChild(hwndTV, hItem);
|
|
||||||
while (childItem) {
|
|
||||||
HTREEITEM nextItem = TreeView_GetNextSibling(hwndTV, childItem);
|
|
||||||
if (RefreshTreeItem(hwndTV, childItem) == FALSE) {
|
|
||||||
(void)TreeView_DeleteItem(hwndTV, childItem);
|
|
||||||
}
|
|
||||||
childItem = nextItem;
|
|
||||||
}
|
|
||||||
bSuccess = TRUE;
|
bSuccess = TRUE;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue