* Unicode fixes to regedit

* Fixed bug 2494
Patch by Carlo Bramix [carlo (dot) bramix (at) libero (dot) it].
See issue #2494 for more details.

svn path=/trunk/; revision=29308
This commit is contained in:
Gregor Brunmar 2007-09-30 13:23:31 +00:00
parent b067e31df6
commit 67dadefc81
4 changed files with 24 additions and 12 deletions

View file

@ -202,7 +202,7 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions
iSuggestionsLength--; iSuggestionsLength--;
/* Are we a root key in HKEY_CLASSES_ROOT? */ /* Are we a root key in HKEY_CLASSES_ROOT? */
if ((hRootKey == HKEY_CLASSES_ROOT) && pszKeyPath[0] && !_tcschr(pszKeyPath, '\\')) if ((hRootKey == HKEY_CLASSES_ROOT) && pszKeyPath[0] && !_tcschr(pszKeyPath, TEXT('\\')))
{ {
do do
{ {

View file

@ -150,7 +150,7 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
/* load appropriate string*/ /* load appropriate string*/
LPTSTR lpsz = str; LPTSTR lpsz = str;
/* first newline terminates actual string*/ /* first newline terminates actual string*/
lpsz = _tcschr(lpsz, '\n'); lpsz = _tcschr(lpsz, _T('\n'));
if (lpsz != NULL) if (lpsz != NULL)
*lpsz = '\0'; *lpsz = '\0';
} }
@ -877,7 +877,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (lRet != ERROR_SUCCESS) hKey = 0; if (lRet != ERROR_SUCCESS) hKey = 0;
} }
switch (LOWORD(wParam)) { switch (LOWORD(wParam)) {
case ID_EDIT_MODIFY: case ID_EDIT_MODIFY:
if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE)) if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE))
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath); RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
@ -887,13 +887,23 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath); RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
break; break;
case ID_EDIT_RENAME: case ID_EDIT_RENAME:
if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1) if (GetFocus() == g_pChildWnd->hListWnd)
{ {
item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED); if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1)
if(item > -1) {
{ item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED);
(void)ListView_EditLabel(g_pChildWnd->hListWnd, item); if(item > -1)
} {
(void)ListView_EditLabel(g_pChildWnd->hListWnd, item);
}
}
}
if (GetFocus() == g_pChildWnd->hTreeWnd)
{
/* Get focused entry of treeview (if any) */
HTREEITEM hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd);
if (hItem != NULL)
(void)TreeView_EditLabel(g_pChildWnd->hTreeWnd, hItem);
} }
break; break;
case ID_EDIT_DELETE: case ID_EDIT_DELETE:

View file

@ -1735,7 +1735,7 @@ static LONG RegNextKey(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength)
/* Go up and find the next sibling key */ /* Go up and find the next sibling key */
do do
{ {
s = _tcsrchr(lpSubKey, '\\'); s = _tcsrchr(lpSubKey, TEXT('\\'));
if (s) if (s)
{ {
*s = '\0'; *s = '\0';
@ -1832,7 +1832,7 @@ LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
if (lResult != ERROR_SUCCESS) if (lResult != ERROR_SUCCESS)
return lResult; return lResult;
s = _tcsrchr(lpSubKey, '\\'); s = _tcsrchr(lpSubKey, TEXT('\\'));
s = s ? s + 1 : lpSubKey; s = s ? s + 1 : lpSubKey;
} }
while(!(dwSearchFlags & RSF_LOOKATKEYS) || !RegSearchCompare(s, pszSearchString, dwSearchFlags)); while(!(dwSearchFlags & RSF_LOOKATKEYS) || !RegSearchCompare(s, pszSearchString, dwSearchFlags));
@ -1871,3 +1871,4 @@ BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lp
} }

View file

@ -602,7 +602,7 @@ BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath)
while(keyPath[0]) while(keyPath[0])
{ {
s = _tcschr(keyPath, '\\'); s = _tcschr(keyPath, TEXT('\\'));
lstrcpyn(szPathPart, keyPath, s ? s - keyPath + 1 : _tcslen(keyPath) + 1); lstrcpyn(szPathPart, keyPath, s ? s - keyPath + 1 : _tcslen(keyPath) + 1);
/* Special case for root to expand root key abbreviations */ /* Special case for root to expand root key abbreviations */
@ -656,3 +656,4 @@ BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath)
return TRUE; return TRUE;
} }