[BROWSEUI] Respect status bar display state in Folders/Search panes (#5445)

- Use proper window styles when creating status bar window.
- Specify WS_VISIBLE style only when status bar display is enabled.
- Use ::CreateWindowExW() with a global namespace scope operator.
- Fix some magic constants.

CORE-19027
This commit is contained in:
Carl J. Bialorucki 2023-07-16 16:14:33 -06:00 committed by GitHub
parent 726c46d2da
commit bfadb22da1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -177,6 +177,7 @@
#define IDS_SEARCH_FOLDER 9234
#define IDS_SEARCH_RESULTS 30520
#define IDS_SEARCH_OPEN_FOLDER 40960
#define IDC_STATUSBAR 40961
#define IDS_PARSE_ADDR_ERR_TITLE 9600
#define IDS_PARSE_ADDR_ERR_TEXT 9601

View file

@ -788,9 +788,12 @@ HRESULT CShellBrowser::Initialize()
// create status bar
fStatusBar = CreateWindow(STATUSCLASSNAMEW, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
SBT_NOBORDERS | SBT_TOOLTIPS, 0, 0, 500, 20, m_hWnd, (HMENU)0xa001,
_AtlBaseModule.GetModuleInstance(), 0);
DWORD dwStatusStyle = WS_CHILD | WS_CLIPSIBLINGS | SBARS_SIZEGRIP | SBARS_TOOLTIPS;
if (fStatusBarVisible)
dwStatusStyle |= WS_VISIBLE;
fStatusBar = ::CreateWindowExW(0, STATUSCLASSNAMEW, NULL, dwStatusStyle,
0, 0, 500, 20, m_hWnd, (HMENU)IDC_STATUSBAR,
_AtlBaseModule.GetModuleInstance(), 0);
ShowWindow(SW_SHOWNORMAL);
UpdateWindow();
@ -1878,7 +1881,7 @@ bool IUnknownIsEqual(IUnknown *int1, IUnknown *int2)
HRESULT STDMETHODCALLTYPE CShellBrowser::GetBorderDW(IUnknown *punkObj, LPRECT prcBorder)
{
static const INT excludeItems[] = { 1, 1, 1, 0xa001, 0, 0 };
static const INT excludeItems[] = { 1, 1, 1, IDC_STATUSBAR, 0, 0 };
RECT availableBounds;
@ -1985,7 +1988,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::QueryStatus(const GUID *pguidCmdGroup,
{
switch (prgCmds->cmdID)
{
case 0xa022: // up level
case IDM_GOTO_UPONELEVEL:
prgCmds->cmdf = OLECMDF_SUPPORTED;
if (fCurrentDirectoryPIDL->mkid.cb != 0)
prgCmds->cmdf |= OLECMDF_ENABLED;
@ -3473,7 +3476,7 @@ LRESULT CShellBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHa
{
CComPtr<IDockingWindow> dockingWindow;
RECT availableBounds;
static const INT excludeItems[] = {1, 1, 1, 0xa001, 0, 0};
static const INT excludeItems[] = {1, 1, 1, IDC_STATUSBAR, 0, 0};
HRESULT hResult;
if (wParam != SIZE_MINIMIZED)