diff --git a/reactos/base/applications/regedit/childwnd.c b/reactos/base/applications/regedit/childwnd.c index b283e437491..3875c314bf3 100644 --- a/reactos/base/applications/regedit/childwnd.c +++ b/reactos/base/applications/regedit/childwnd.c @@ -202,7 +202,7 @@ static void SuggestKeys(HKEY hRootKey, LPCTSTR pszKeyPath, LPTSTR pszSuggestions iSuggestionsLength--; /* 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 { diff --git a/reactos/base/applications/regedit/framewnd.c b/reactos/base/applications/regedit/framewnd.c index 5f09e17cff0..4f746939a82 100644 --- a/reactos/base/applications/regedit/framewnd.c +++ b/reactos/base/applications/regedit/framewnd.c @@ -150,7 +150,7 @@ static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu) /* load appropriate string*/ LPTSTR lpsz = str; /* first newline terminates actual string*/ - lpsz = _tcschr(lpsz, '\n'); + lpsz = _tcschr(lpsz, _T('\n')); if (lpsz != NULL) *lpsz = '\0'; } @@ -877,7 +877,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (lRet != ERROR_SUCCESS) hKey = 0; } - switch (LOWORD(wParam)) { + switch (LOWORD(wParam)) { case ID_EDIT_MODIFY: if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE)) 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); break; 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(item > -1) - { - (void)ListView_EditLabel(g_pChildWnd->hListWnd, item); - } + if(ListView_GetSelectedCount(g_pChildWnd->hListWnd) == 1) + { + item = ListView_GetNextItem(g_pChildWnd->hListWnd, -1, LVNI_SELECTED); + 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; case ID_EDIT_DELETE: diff --git a/reactos/base/applications/regedit/regproc.c b/reactos/base/applications/regedit/regproc.c index 78d2f65f52d..5b360b55c81 100644 --- a/reactos/base/applications/regedit/regproc.c +++ b/reactos/base/applications/regedit/regproc.c @@ -1735,7 +1735,7 @@ static LONG RegNextKey(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength) /* Go up and find the next sibling key */ do { - s = _tcsrchr(lpSubKey, '\\'); + s = _tcsrchr(lpSubKey, TEXT('\\')); if (s) { *s = '\0'; @@ -1832,7 +1832,7 @@ LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength, if (lResult != ERROR_SUCCESS) return lResult; - s = _tcsrchr(lpSubKey, '\\'); + s = _tcsrchr(lpSubKey, TEXT('\\')); s = s ? s + 1 : lpSubKey; } while(!(dwSearchFlags & RSF_LOOKATKEYS) || !RegSearchCompare(s, pszSearchString, dwSearchFlags)); @@ -1871,3 +1871,4 @@ BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lp } + diff --git a/reactos/base/applications/regedit/treeview.c b/reactos/base/applications/regedit/treeview.c index dc696c02cf7..884da97077d 100644 --- a/reactos/base/applications/regedit/treeview.c +++ b/reactos/base/applications/regedit/treeview.c @@ -602,7 +602,7 @@ BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath) while(keyPath[0]) { - s = _tcschr(keyPath, '\\'); + s = _tcschr(keyPath, TEXT('\\')); lstrcpyn(szPathPart, keyPath, s ? s - keyPath + 1 : _tcslen(keyPath) + 1); /* Special case for root to expand root key abbreviations */ @@ -656,3 +656,4 @@ BOOL SelectNode(HWND hwndTV, LPCTSTR keyPath) return TRUE; } +