From c1940e397e56c6d8fc2f1fbf7987487360ec935d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Thu, 22 May 2008 00:00:12 +0200 Subject: [PATCH] regedit: Set selected key name as default favourite name. --- programs/regedit/framewnd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index d1fb9734ca..fd20a623c1 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -506,9 +506,17 @@ static INT_PTR CALLBACK addtofavorites_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w switch(uMsg) { case WM_INITDIALOG: + { + HKEY hKeyRoot = NULL; + LPSTR ItemPath = GetItemPath(g_pChildWnd->hTreeWnd, NULL, &hKeyRoot); + + if(!ItemPath || !*ItemPath) + ItemPath = GetItemFullPath(g_pChildWnd->hTreeWnd, NULL, FALSE); EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); + SetWindowText(hwndValue, ItemPath); SendMessage(hwndValue, EM_SETLIMITTEXT, 127, 0); return TRUE; + } case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_VALUE_NAME: