ReactOS 0.4.16-dev-2279-gc890759
CFontFolderViewCB.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Font Shell Extension
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Fonts folder view callback implementation
5 * COPYRIGHT: Copyright 2026 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
6 */
7
8#include "precomp.h"
9
11
13{
14 ATLASSERT(pFontExt);
15 ATLASSERT(psv);
16 ATLASSERT(pidlParent);
17 m_pFontExt = pFontExt;
18 m_pShellView = psv;
19 m_pidlParent.Attach(ILClone(pidlParent));
20 if (!m_pidlParent)
21 ERR("m_pidlParent was null\n");
22}
23
25{
26 lEvent &= ~SHCNE_INTERRUPT;
27
28 switch (lEvent)
29 {
30 case SHCNE_CREATE:
32 case SHCNE_UPDATEDIR:
33 // Refresh font cache and notify the system about the font change
34 if (g_FontCache)
36 break;
37 case SHCNE_DELETE:
38 break;
39 default:
40 return TRUE; // We don't want this event
41 }
42
43 return FALSE;
44}
45
48{
49 switch (uMsg)
50 {
51 case SFVM_QUERYFSNOTIFY: // Registering change notification
52 {
53 if (!m_pShellView || !m_pFontExt)
54 return E_FAIL;
55 // Now, we can get the view window
56 m_pShellView->GetWindow(&m_hwndView);
58 return S_OK;
59 }
60 case SFVM_FSNOTIFY: // Change notification
61 {
63 return S_FALSE; // Don't process
64 return S_OK;
65 }
66 }
67 return E_NOTIMPL;
68}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ERR(fmt,...)
Definition: precomp.h:57
#define STDMETHODIMP
Definition: basetyps.h:43
void Read()
Definition: CFontCache.cpp:243
void SetViewWindow(HWND hwndView)
Definition: CFontExt.cpp:114
BOOL FilterEvent(PIDLIST_ABSOLUTE *apidls, LONG lEvent) const
void Initialize(CFontExt *pFontExt, IShellView *psv, LPCITEMIDLIST pidlParent)
STDMETHODIMP MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) override
CComHeapPtr< ITEMIDLIST > m_pidlParent
CComPtr< IShellView > m_pShellView
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_OK
Definition: intsafe.h:52
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:238
#define SHCNE_DELETE
Definition: shlobj.h:1899
#define SHCNE_RENAMEITEM
Definition: shlobj.h:1897
#define SHCNE_UPDATEDIR
Definition: shlobj.h:1909
#define SHCNE_CREATE
Definition: shlobj.h:1898
#define SFVM_FSNOTIFY
Definition: shlobj.h:1314
#define SFVM_QUERYFSNOTIFY
Definition: shlobj.h:1323
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HANDLE lEvent
Definition: tftpd.cpp:56
#define S_FALSE
Definition: winerror.h:3451