[BROWSEUI] Add an option to use full folder path in the window title (#5468)

- Set `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CabinetState\FullPath` to 0 by default.
  Adding this registry value also enables the "Display the full path in the title bar" option in our folder options window.
- Query the same registry key when the file explorer is started to determine whether to use the full path or the display name in the window title.

CORE-19046 CORE-18904
This commit is contained in:
Carl J. Bialorucki 2023-07-22 08:50:39 -06:00 committed by GitHub
parent f85b8fb564
commit 6d37456542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 4 deletions

View File

@ -1899,6 +1899,8 @@ HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","StartMenuLog
; "Hidden" to be changed to 2 if we later want to have "Hide hidden files by default"
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","Hidden",0x00010003,1
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ShowSuperHidden",0x00010003,0
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CabinetState",,0x00000012
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CabinetState","FullPath",0x00010003,0
HKCU,"SOFTWARE\Microsoft\Internet Explorer\Main","StatusBarOther",0x00010003,1
; ComDlg32

View File

@ -350,6 +350,7 @@ public:
HRESULT UpdateUpState();
void UpdateGotoMenu(HMENU theMenu);
void UpdateViewMenu(HMENU theMenu);
void LoadSettings();
/* // *** IDockingWindowFrame methods ***
virtual HRESULT STDMETHODCALLTYPE AddToolbar(IUnknown *punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags);
@ -709,10 +710,6 @@ CShellBrowser::CShellBrowser()
fCurrentShellViewWindow = NULL;
fCurrentDirectoryPIDL = NULL;
fStatusBar = NULL;
fStatusBarVisible = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main",
L"StatusBarOther",
FALSE,
FALSE);
fCurrentMenuBar = NULL;
fHistoryObject = NULL;
fHistoryStream = NULL;
@ -786,6 +783,7 @@ HRESULT CShellBrowser::Initialize()
fToolbarProxy.Initialize(m_hWnd, clientBar);
LoadSettings();
// create status bar
DWORD dwStatusStyle = WS_CHILD | WS_CLIPSIBLINGS | SBARS_SIZEGRIP | SBARS_TOOLTIPS;
@ -1510,6 +1508,19 @@ void CShellBrowser::RepositionBars()
clientRect.bottom - clientRect.top, SWP_NOOWNERZORDER | SWP_NOZORDER);
}
void CShellBrowser::LoadSettings()
{
fStatusBarVisible = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main",
L"StatusBarOther",
FALSE,
FALSE);
fCabinetState.fFullPathTitle = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState",
L"FullPath",
FALSE,
FALSE);
}
HRESULT CShellBrowser::FireEvent(DISPID dispIdMember, int argCount, VARIANT *arguments)
{
DISPPARAMS params;