regedit: Update the status bar text when a treeview node is renamed.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-07-12 11:08:46 +00:00 committed by Alexandre Julliard
parent db11f739ea
commit 182b6fb545
1 changed files with 7 additions and 5 deletions

View File

@ -454,18 +454,20 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
LPNMTVDISPINFOW dispInfo = (LPNMTVDISPINFOW)lParam; LPNMTVDISPINFOW dispInfo = (LPNMTVDISPINFOW)lParam;
LPWSTR path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey); LPWSTR path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
BOOL res = RenameKey(hWnd, hRootKey, path, dispInfo->item.pszText); BOOL res = RenameKey(hWnd, hRootKey, path, dispInfo->item.pszText);
HeapFree(GetProcessHeap(), 0, path);
if (res) { if (res) {
TVITEMEXW item; TVITEMW item;
LPWSTR fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd, WCHAR *fullPath;
dispInfo->item.pszText);
item.mask = TVIF_HANDLE | TVIF_TEXT; item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = (HTREEITEM)SendMessageW(g_pChildWnd->hTreeWnd, TVM_GETNEXTITEM, TVGN_CARET, 0); item.hItem = dispInfo->item.hItem;
item.pszText = dispInfo->item.pszText; item.pszText = dispInfo->item.pszText;
SendMessageW( g_pChildWnd->hTreeWnd, TVM_SETITEMW, 0, (LPARAM)&item ); SendMessageW( g_pChildWnd->hTreeWnd, TVM_SETITEMW, 0, (LPARAM)&item );
path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd, path);
SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)fullPath); SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)fullPath);
HeapFree(GetProcessHeap(), 0, fullPath); HeapFree(GetProcessHeap(), 0, fullPath);
}
HeapFree(GetProcessHeap(), 0, path); HeapFree(GetProcessHeap(), 0, path);
}
SetWindowLongPtrW(g_pChildWnd->hTreeWnd, GWLP_USERDATA, 0); SetWindowLongPtrW(g_pChildWnd->hTreeWnd, GWLP_USERDATA, 0);
return res; return res;
} }