Hugh McMaster : regedit: Update the status bar text when a treeview node is renamed.
Alexandre Julliard
julliard at winehq.org
Wed Jul 12 15:37:26 CDT 2017
Module: wine
Branch: master
Commit: 182b6fb545f49ca52200e199a2f947452c70f5fd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=182b6fb545f49ca52200e199a2f947452c70f5fd
Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date: Wed Jul 12 11:08:46 2017 +0000
regedit: Update the status bar text when a treeview node is renamed.
Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/regedit/childwnd.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 0e4ed57..37f4261 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -454,18 +454,20 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
LPNMTVDISPINFOW dispInfo = (LPNMTVDISPINFOW)lParam;
LPWSTR path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
BOOL res = RenameKey(hWnd, hRootKey, path, dispInfo->item.pszText);
+ HeapFree(GetProcessHeap(), 0, path);
if (res) {
- TVITEMEXW item;
- LPWSTR fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd,
- dispInfo->item.pszText);
+ TVITEMW item;
+ WCHAR *fullPath;
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;
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);
HeapFree(GetProcessHeap(), 0, fullPath);
+ HeapFree(GetProcessHeap(), 0, path);
}
- HeapFree(GetProcessHeap(), 0, path);
SetWindowLongPtrW(g_pChildWnd->hTreeWnd, GWLP_USERDATA, 0);
return res;
}
More information about the wine-cvs
mailing list