https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23f31cf7b400f4503a6c4…
commit 23f31cf7b400f4503a6c4ec412047972281fdbf3
Author: Whindmar Saksit <whindsaks(a)proton.me>
AuthorDate: Mon Nov 13 16:13:21 2023 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Nov 13 16:13:21 2023 +0100
[SHELL32] Support more FOLDERFLAGS in DefView (#5760)
This adds support for more of the FOLDERSETTINGS FOLDERFLAGS.
- Turned on LVS_EX_DOUBLEBUFFER even though there is no setting for it.
XP has it on for folders but not the desktop and this matches that.
Vista might turn it on for its shadow labels on the desktop, further
investigation required.
- Fixes a bug where LVS_EX_SNAPTOGRID was incorrectly assigned where
the WS_EX flags go.
- LVS_AUTOARRANGE seems to be incorrectly forced on but for compatibility
I decided to leave it but added a comment. The existing code already
has the check for FWF_AUTOARRANGE.
---
dll/win32/shell32/CDefView.cpp | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index a06feb085b4..9f91cf9ead9 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -629,19 +629,27 @@ void CDefView::UpdateStatusbar()
BOOL CDefView::CreateList()
{
HRESULT hr;
- DWORD dwStyle, dwExStyle;
+ DWORD dwStyle, dwExStyle, ListExStyle;
UINT ViewMode;
TRACE("%p\n", this);
dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN |
- LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE;
+ LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_AUTOARRANGE; // FIXME: Why is
LVS_AUTOARRANGE here?
dwExStyle = WS_EX_CLIENTEDGE;
+ ListExStyle = 0;
if (m_FolderSettings.fFlags & FWF_DESKTOP)
+ {
+ m_FolderSettings.fFlags |= FWF_NOCLIENTEDGE | FWF_NOSCROLL;
dwStyle |= LVS_ALIGNLEFT;
+ }
else
- dwStyle |= LVS_ALIGNTOP | LVS_SHOWSELALWAYS;
+ {
+ dwStyle |= LVS_SHOWSELALWAYS; // MSDN says FWF_SHOWSELALWAYS is deprecated,
always turn on for folders.
+ dwStyle |= (m_FolderSettings.fFlags & FWF_ALIGNLEFT) ? LVS_ALIGNLEFT :
LVS_ALIGNTOP;
+ ListExStyle = LVS_EX_DOUBLEBUFFER;
+ }
ViewMode = m_FolderSettings.ViewMode;
hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode);
@@ -680,14 +688,27 @@ BOOL CDefView::CreateList()
dwStyle |= LVS_AUTOARRANGE;
if (m_FolderSettings.fFlags & FWF_SNAPTOGRID)
- dwExStyle |= LVS_EX_SNAPTOGRID;
-
- if (m_FolderSettings.fFlags & FWF_DESKTOP)
- m_FolderSettings.fFlags |= FWF_NOCLIENTEDGE | FWF_NOSCROLL;
+ ListExStyle |= LVS_EX_SNAPTOGRID;
if (m_FolderSettings.fFlags & FWF_SINGLESEL)
dwStyle |= LVS_SINGLESEL;
+ if (m_FolderSettings.fFlags & FWF_FULLROWSELECT)
+ ListExStyle |= LVS_EX_FULLROWSELECT;
+
+ if (m_FolderSettings.fFlags & FWF_SINGLECLICKACTIVATE)
+ ListExStyle |= LVS_EX_TRACKSELECT | LVS_EX_ONECLICKACTIVATE;
+
+ if (m_FolderSettings.fFlags & FWF_NOCOLUMNHEADER)
+ dwStyle |= LVS_NOCOLUMNHEADER;
+
+#if 0
+ // FIXME: Because this is a negative, everyone gets the new flag by default unless
they
+ // opt out. This code should be enabled when the shell looks like Vista instead of
2003.
+ if (!(m_FolderSettings.fFlags & FWF_NOHEADERINALLVIEWS))
+ ListExStyle |= LVS_EX_HEADERINALLVIEWS;
+#endif
+
if (m_FolderSettings.fFlags & FWF_NOCLIENTEDGE)
dwExStyle &= ~WS_EX_CLIENTEDGE;
@@ -697,6 +718,8 @@ BOOL CDefView::CreateList()
if (!m_ListView)
return FALSE;
+ m_ListView.SetExtendedListViewStyle(ListExStyle);
+
m_sortInfo.bIsAscending = TRUE;
m_sortInfo.nHeaderID = -1;
m_sortInfo.nLastHeaderID = -1;