https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5da934e34dfc257b5fb37…
commit 5da934e34dfc257b5fb37f172713ccd8d0269ad5
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Oct 7 08:16:35 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Oct 7 08:16:35 2021 +0900
[SHELL32] Don't smartass-renaming on folders (#3993)
Selection on renaming folders shouldn't select the extension-like part of
filename.
CORE-17793
---
dll/win32/shell32/CDefView.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 0c3f865febc..03a639a9026 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -2093,9 +2093,11 @@ LRESULT CDefView::OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL &bHandl
HWND hEdit =
reinterpret_cast<HWND>(m_ListView.SendMessage(LVM_GETEDITCONTROL));
SHLimitInputEdit(hEdit, m_pSFParent);
- if (!(dwAttr & SFGAO_LINK) && (lpdi->item.mask &
LVIF_TEXT) && !SelectExtOnRename())
+ LPWSTR pszText = lpdi->item.pszText;
+ if (!(dwAttr & (SFGAO_LINK | SFGAO_FOLDER)) && (dwAttr &
SFGAO_FILESYSTEM) &&
+ (lpdi->item.mask & LVIF_TEXT) &&
+ !SelectExtOnRename() && !SHELL_FS_HideExtension(pszText))
{
- LPWSTR pszText = lpdi->item.pszText;
LPWSTR pchDotExt = PathFindExtensionW(pszText);
::PostMessageW(hEdit, EM_SETSEL, 0, pchDotExt - pszText);
::PostMessageW(hEdit, EM_SCROLLCARET, 0, 0);