Commit c36fec1c authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

regedit: Set the unicode flag for the treeview.

parent 0035421e
...@@ -350,11 +350,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa ...@@ -350,11 +350,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_NOTIFY: case WM_NOTIFY:
if (((int)wParam == TREE_WINDOW) && (g_pChildWnd != NULL)) { if (((int)wParam == TREE_WINDOW) && (g_pChildWnd != NULL)) {
switch (((LPNMHDR)lParam)->code) { switch (((LPNMHDR)lParam)->code) {
case TVN_ITEMEXPANDING: case TVN_ITEMEXPANDINGW:
return !OnTreeExpanding(g_pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam); return !OnTreeExpanding(g_pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
case TVN_SELCHANGED: case TVN_SELCHANGEDW:
OnTreeSelectionChanged(g_pChildWnd->hTreeWnd, g_pChildWnd->hListWnd, OnTreeSelectionChanged(g_pChildWnd->hTreeWnd, g_pChildWnd->hListWnd,
((NMTREEVIEW *)lParam)->itemNew.hItem, TRUE); ((NMTREEVIEWW *)lParam)->itemNew.hItem, TRUE);
break; break;
case NM_SETFOCUS: case NM_SETFOCUS:
g_pChildWnd->nFocusPanel = 0; g_pChildWnd->nFocusPanel = 0;
...@@ -366,25 +366,23 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa ...@@ -366,25 +366,23 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL); TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
break; break;
} }
case TVN_ENDLABELEDIT: { case TVN_ENDLABELEDITW: {
HKEY hRootKey; HKEY hRootKey;
LPNMTVDISPINFO dispInfo = (LPNMTVDISPINFO)lParam; LPNMTVDISPINFOW dispInfo = (LPNMTVDISPINFOW)lParam;
WCHAR* itemText = GetWideString(dispInfo->item.pszText);
LPWSTR path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey); LPWSTR path = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
BOOL res = RenameKey(hWnd, hRootKey, path, itemText); BOOL res = RenameKey(hWnd, hRootKey, path, dispInfo->item.pszText);
if (res) { if (res) {
TVITEMEXW item; TVITEMEXW item;
LPWSTR fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd, LPWSTR fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd,
itemText); dispInfo->item.pszText);
item.mask = TVIF_HANDLE | TVIF_TEXT; item.mask = TVIF_HANDLE | TVIF_TEXT;
item.hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd); item.hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
item.pszText = itemText; item.pszText = dispInfo->item.pszText;
SendMessageW( g_pChildWnd->hTreeWnd, TVM_SETITEMW, 0, (LPARAM)&item ); SendMessageW( g_pChildWnd->hTreeWnd, TVM_SETITEMW, 0, (LPARAM)&item );
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);
HeapFree(GetProcessHeap(), 0, itemText);
return res; return res;
} }
default: default:
......
...@@ -670,6 +670,7 @@ HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, UINT id) ...@@ -670,6 +670,7 @@ HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, UINT id)
WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT, WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
0, 0, rcClient.right, rcClient.bottom, 0, 0, rcClient.right, rcClient.bottom,
hwndParent, (HMENU)ULongToHandle(id), hInst, NULL); hwndParent, (HMENU)ULongToHandle(id), hInst, NULL);
SendMessageW(hwndTV, TVM_SETUNICODEFORMAT, TRUE, 0);
/* Initialize the image list, and add items to the control. */ /* Initialize the image list, and add items to the control. */
if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) { if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) {
DestroyWindow(hwndTV); DestroyWindow(hwndTV);
......
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