https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bfadb22da19bd50118ab4…
commit bfadb22da19bd50118ab4671b80dadd575cc9525
Author: Carl J. Bialorucki <cbialo2(a)outlook.com>
AuthorDate: Sun Jul 16 16:14:33 2023 -0600
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jul 17 01:14:33 2023 +0300
[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
---
dll/win32/browseui/resource.h | 1 +
dll/win32/browseui/shellbrowser.cpp | 15 +++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h
index 9a80d85e045..9620a89eeb5 100644
--- a/dll/win32/browseui/resource.h
+++ b/dll/win32/browseui/resource.h
@@ -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
diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp
index 3aec6c38272..71068d22ef4 100644
--- a/dll/win32/browseui/shellbrowser.cpp
+++ b/dll/win32/browseui/shellbrowser.cpp
@@ -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)