https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ee231d00b955b2595ab4f…
commit ee231d00b955b2595ab4fa3416e8d5bf440199a7
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Aug 11 16:00:16 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Aug 11 16:00:16 2020 +0900
[SHELL32] Improve callbacking of CDefView (#3031)
- Delete DefMessageSFVCB method.
- Add some callbacking.
---
dll/win32/shell32/CDefView.cpp | 28 +++++++++++-----------------
1 file changed, 11 insertions(+), 17 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 06d7c659f03..cb5dd140eb1 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -130,7 +130,6 @@ class CDefView :
BOOL CreateList();
void UpdateListColors();
BOOL InitList();
- HRESULT DefMessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam);
static INT CALLBACK ListViewCompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM
lpData);
PCUITEMID_CHILD _PidlByItem(int i);
@@ -397,6 +396,8 @@ CDefView::~CDefView()
{
TRACE(" destroying IShellView(%p)\n", this);
+ _DoFolderViewCB(SFVM_VIEWRELEASE, 0, 0);
+
if (m_viewinfo_data.hbmBack)
{
::DeleteObject(m_viewinfo_data.hbmBack);
@@ -537,7 +538,7 @@ BOOL CDefView::CreateList()
dwStyle |= LVS_ALIGNTOP | LVS_SHOWSELALWAYS;
ViewMode = m_FolderSettings.ViewMode;
- hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, NULL, (LPARAM)&ViewMode);
+ hr = _DoFolderViewCB(SFVM_DEFVIEWMODE, 0, (LPARAM)&ViewMode);
if (SUCCEEDED(hr))
{
if (ViewMode >= FVM_FIRST && ViewMode <= FVM_LAST)
@@ -797,6 +798,9 @@ int CDefView::LV_AddItem(PCUITEMID_CHILD pidl)
TRACE("(%p)(pidl=%p)\n", this, pidl);
+ if (_DoFolderViewCB(SFVM_ADDINGOBJECT, 0, (LPARAM)pidl) == S_FALSE)
+ return -1;
+
lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/
lvItem.iItem = m_ListView.GetItemCount(); /*add the item to the end of
the list*/
lvItem.iSubItem = 0;
@@ -1000,7 +1004,7 @@ HRESULT CDefView::FillList()
m_ListView.InvalidateRect(NULL, TRUE);
}
- _DoFolderViewCB(SFVM_LISTREFRESHED, NULL, NULL);
+ _DoFolderViewCB(SFVM_LISTREFRESHED, 0, 0);
return S_OK;
}
@@ -2416,6 +2420,8 @@ HRESULT WINAPI CDefView::Refresh()
{
TRACE("(%p)\n", this);
+ _DoFolderViewCB(SFVM_LISTREFRESHED, TRUE, 0);
+
m_ListView.DeleteAllItems();
FillList();
@@ -2466,6 +2472,7 @@ HRESULT WINAPI CDefView::DestroyViewWindow()
if (m_hWnd)
{
+ _DoFolderViewCB(SFVM_WINDOWCLOSING, (WPARAM)m_hWnd, 0);
DestroyWindow();
}
@@ -2888,7 +2895,7 @@ HRESULT STDMETHODCALLTYPE CDefView::CreateViewWindow3(IShellBrowser
*psb, IShell
if (!*hwnd)
return E_FAIL;
- _DoFolderViewCB(SFVM_WINDOWCREATED, (WPARAM)m_hWnd, NULL);
+ _DoFolderViewCB(SFVM_WINDOWCREATED, (WPARAM)m_hWnd, 0);
SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
UpdateWindow();
@@ -3541,14 +3548,6 @@ HRESULT CDefView::_MergeToolbar()
return S_OK;
}
-// The default processing of IShellFolderView callbacks
-HRESULT CDefView::DefMessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- // TODO: SFVM_GET_CUSTOMVIEWINFO, SFVM_WINDOWCREATED
- TRACE("CDefView::DefMessageSFVCB uMsg=%u\n", uMsg);
- return E_NOTIMPL;
-}
-
HRESULT CDefView::_DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HRESULT hr = E_NOTIMPL;
@@ -3558,11 +3557,6 @@ HRESULT CDefView::_DoFolderViewCB(UINT uMsg, WPARAM wParam, LPARAM
lParam)
hr = m_pShellFolderViewCB->MessageSFVCB(uMsg, wParam, lParam);
}
- if (hr == E_NOTIMPL)
- {
- hr = DefMessageSFVCB(uMsg, wParam, lParam);
- }
-
return hr;
}