[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    12/12 regedit: Set the unicode flag for the treeview
From:       Alexander Nicolaysen =?iso-8859-1?q?S=F8rnes?= <alex () thehandofagony ! com>
Date:       2008-08-31 23:04:56
Message-ID: 200809010104.56394.alex () thehandofagony ! com
[Download RAW message or body]

12/12 regedit: Set the unicode flag for the treeview


Alexander N. S=F8rnes

["0012-regedit-Set-the-unicode-flag-for-the-treeview.patch" (text/x-diff)]

From 38967311baca8670943b6b04d3aaaa652d90f9b7 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= <alex@thehandofagony.com>
Date: Sun, 31 Aug 2008 17:16:21 +0200
Subject: [PATCH] regedit: Set the unicode flag for the treeview

---
 programs/regedit/childwnd.c |   18 ++++++++----------
 programs/regedit/treeview.c |    1 +
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/programs/regedit/childwnd.c b/programs/regedit/childwnd.c
index 45053a7..9879c95 100644
--- a/programs/regedit/childwnd.c
+++ b/programs/regedit/childwnd.c
@@ -350,11 +350,11 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM \
wParam, LPARAM lPa  case WM_NOTIFY:
         if (((int)wParam == TREE_WINDOW) && (g_pChildWnd != NULL)) {
             switch (((LPNMHDR)lParam)->code) {
-            case TVN_ITEMEXPANDING:
+            case TVN_ITEMEXPANDINGW:
                 return !OnTreeExpanding(g_pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
-            case TVN_SELCHANGED:
+            case TVN_SELCHANGEDW:
                 OnTreeSelectionChanged(g_pChildWnd->hTreeWnd, g_pChildWnd->hListWnd,
-                    ((NMTREEVIEW *)lParam)->itemNew.hItem, TRUE);
+                    ((NMTREEVIEWW *)lParam)->itemNew.hItem, TRUE);
                 break;
 	    case NM_SETFOCUS:
 		g_pChildWnd->nFocusPanel = 0;
@@ -366,25 +366,23 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM \
wParam, LPARAM lPa  TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
 		break;
             }
-	    case TVN_ENDLABELEDIT: {
+	    case TVN_ENDLABELEDITW: {
 		HKEY hRootKey;
-	        LPNMTVDISPINFO dispInfo = (LPNMTVDISPINFO)lParam;
-		    WCHAR* itemText = GetWideString(dispInfo->item.pszText);
+	        LPNMTVDISPINFOW dispInfo = (LPNMTVDISPINFOW)lParam;
 		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) {
 		    TVITEMEXW item;
                     LPWSTR fullPath = GetPathFullPath(g_pChildWnd->hTreeWnd,
-                     itemText);
+                     dispInfo->item.pszText);
 		    item.mask = TVIF_HANDLE | TVIF_TEXT;
 		    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(hStatusBar, SB_SETTEXTW, 0, (LPARAM)fullPath);
                     HeapFree(GetProcessHeap(), 0, fullPath);
 		}
                 HeapFree(GetProcessHeap(), 0, path);
-                HeapFree(GetProcessHeap(), 0, itemText);
 		return res;
 	    }
             default:
diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c
index 6e4131c..b462658 100644
--- a/programs/regedit/treeview.c
+++ b/programs/regedit/treeview.c
@@ -670,6 +670,7 @@ HWND CreateTreeView(HWND hwndParent, LPWSTR pHostName, UINT id)
                             WS_VISIBLE | WS_CHILD | WS_TABSTOP | TVS_HASLINES | \
TVS_HASBUTTONS | TVS_LINESATROOT,  0, 0, rcClient.right, rcClient.bottom,
                             hwndParent, (HMENU)ULongToHandle(id), hInst, NULL);
+    (void)TreeView_SetUnicodeFormat(hwndTV, TRUE);
     /* Initialize the image list, and add items to the control.  */
     if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pHostName)) {
         DestroyWindow(hwndTV);
-- 
1.5.3.7





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic