From abc98980080e771a61015cd5e3a5abe19141d6ca Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Thu, 6 Oct 2005 03:23:09 +0000 Subject: [PATCH] Regedit: Now saves last key visited, like Windows regedit svn path=/trunk/; revision=18289 --- reactos/subsys/system/regedit/childwnd.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reactos/subsys/system/regedit/childwnd.c b/reactos/subsys/system/regedit/childwnd.c index dd39f60c85b..d4a6a9d52e0 100644 --- a/reactos/subsys/system/regedit/childwnd.c +++ b/reactos/subsys/system/regedit/childwnd.c @@ -414,6 +414,20 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa _stprintf(fullPath, _T("%s\\%s"), rootName, keyPath); SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)fullPath); HeapFree(GetProcessHeap(), 0, fullPath); + + { + HKEY hKey; + TCHAR szBuffer[MAX_PATH]; + _sntprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), _T("My Computer\\%s\\%s"), rootName, keyPath); + + if (RegOpenKey(HKEY_CURRENT_USER, + _T("Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit"), + &hKey) == ERROR_SUCCESS) + { + RegSetValueEx(hKey, _T("LastKey"), 0, REG_SZ, (LPBYTE) szBuffer, _tcslen(szBuffer) * sizeof(szBuffer[0])); + RegCloseKey(hKey); + } + } } } }