HKCU,"SOFTWARE\Microsoft\Windows",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer",,0x00000012
+HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer","SelectExtOnRename",0x00010001,0x00000000
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU",,0x00000012
-
; Default shell for the current user (overrides the defaults from the HKLM Winlogon sub-key)
HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon",,0x00000012
;HKCU,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Shell",0x00020000,"%SystemRoot%\explorer.exe"
return 0;
}
+static BOOL
+SelectExtOnRename(void)
+{
+ HKEY hKey;
+ LONG error;
+ DWORD dwValue = FALSE, cbValue;
+
+ error = RegOpenKeyExW(HKEY_CURRENT_USER,
+ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer",
+ 0, KEY_READ, &hKey);
+ if (error)
+ return dwValue;
+
+ cbValue = sizeof(dwValue);
+ RegQueryValueExW(hKey, L"SelectExtOnRename", NULL, NULL, (LPBYTE)&dwValue, &cbValue);
+
+ RegCloseKey(hKey);
+ return !!dwValue;
+}
+
/**********************************************************
* ShellView_OnNotify()
*/
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;
+ LPWSTR pchDotExt = PathFindExtensionW(pszText);
+ ::PostMessageW(hEdit, EM_SETSEL, 0, pchDotExt - pszText);
+ ::PostMessageW(hEdit, EM_SCROLLCARET, 0, 0);
+ }
+
m_isEditing = TRUE;
return FALSE;
}