Commit 46bff016 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit: Use the treeview item label in the 'Favourites' menu instead of the key path.

parent 27b2519c
...@@ -646,15 +646,21 @@ static INT_PTR CALLBACK addtofavorites_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w ...@@ -646,15 +646,21 @@ static INT_PTR CALLBACK addtofavorites_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM w
switch(uMsg) { switch(uMsg) {
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
HKEY hKeyRoot = NULL; HTREEITEM selected;
LPWSTR ItemPath = GetItemPath(g_pChildWnd->hTreeWnd, NULL, &hKeyRoot); TVITEMW item;
WCHAR buf[128];
selected = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_CARET, 0);
item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = selected;
item.pszText = buf;
item.cchTextMax = COUNT_OF(buf);
SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETITEMW, 0, (LPARAM)&item);
if(!ItemPath || !*ItemPath)
ItemPath = GetItemFullPath(g_pChildWnd->hTreeWnd, NULL, FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);
SetWindowTextW(hwndValue, ItemPath); SetWindowTextW(hwndValue, buf);
SendMessageW(hwndValue, EM_SETLIMITTEXT, 127, 0); SendMessageW(hwndValue, EM_SETLIMITTEXT, 127, 0);
HeapFree(GetProcessHeap(), 0, ItemPath);
return TRUE; return TRUE;
} }
case WM_COMMAND: case WM_COMMAND:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment