[SHELL32] Don't smartass-renaming on folders (#3993)

Selection on renaming folders shouldn't select the extension-like part of filename.
CORE-17793
This commit is contained in:
Katayama Hirofumi MZ 2021-10-07 08:16:35 +09:00 committed by GitHub
parent db7295f864
commit 5da934e34d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);