https://git.reactos.org/?p=reactos.git;a=commitdiff;h=80c53821c9616538b0a8a…
commit 80c53821c9616538b0a8a4a8d29bc03aa13afce4
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Tue Oct 9 20:57:23 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Oct 13 20:28:49 2018 +0200
[SHELL32] CDefView: Query SFVM_DEFVIEWMODE before creating the list view.
CORE-14976
---
dll/win32/shell32/CDefView.cpp | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 32f7e153e7..9e67b441df 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -114,7 +114,7 @@ class CDefView :
private:
HRESULT _MergeToolbar();
BOOL _Sort();
- VOID _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
+ HRESULT _DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
CDefView();
@@ -520,7 +520,9 @@ void CDefView::SetStyle(DWORD dwAdd, DWORD dwRemove)
*/
BOOL CDefView::CreateList()
{
+ HRESULT hr;
DWORD dwStyle, dwExStyle;
+ UINT ViewMode;
TRACE("%p\n", this);
@@ -533,6 +535,16 @@ BOOL CDefView::CreateList()
else
dwStyle |= LVS_ALIGNTOP | LVS_SHOWSELALWAYS;
+ ViewMode = m_FolderSettings.ViewMode;
+ hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, NULL, (LPARAM)&ViewMode);
+ if (SUCCEEDED(hr))
+ {
+ if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST)
+ m_FolderSettings.ViewMode = ViewMode;
+ else
+ ERR("Ignoring invalid ViewMode from SFVM_DEFVIEWMODE: %u (was:
%u)\n", ViewMode, m_FolderSettings.ViewMode);
+ }
+
switch (m_FolderSettings.ViewMode)
{
case FVM_ICON:
@@ -3245,12 +3257,13 @@ HRESULT CDefView::_MergeToolbar()
return S_OK;
}
-VOID CDefView::_DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
+HRESULT CDefView::_DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (m_pShellFolderViewCB)
{
- m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
+ return m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
}
+ return E_NOINTERFACE;
}
HRESULT CDefView_CreateInstance(IShellFolder *pFolder, REFIID riid, LPVOID * ppvOut)