regedit: Use the treeview item label in the 'Favourites' menu instead of the key path.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
27b2519ca4
commit
46bff016ab
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue