ReactOS 0.4.16-dev-2207-geb15453
precomp.h
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: Font folder shell extension
5 * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen@reactos.org>
6 */
7
8#pragma once
9
10#define WIN32_NO_STATUS
11#define COM_NO_WINDOWS_H
12
13#include <windef.h>
14#include <winbase.h>
15#include <winreg.h>
16#include <shlobj.h>
17#include <shlwapi.h>
18#include <tchar.h>
19#include <strsafe.h>
20#include <atlbase.h>
21#include <atlcom.h>
22#include <atlcoll.h>
23#include <atlstr.h>
24#include <wine/debug.h>
25#include <shellutils.h>
26
27extern const GUID CLSID_CFontExt;
28extern LONG g_ModuleRefCnt;
29
31{
34 HWND hwnd = nullptr;
41
42#include "resource.h"
43#include "fontpidl.hpp"
44#include "CFontCache.hpp"
45#include "CFontExt.hpp"
46#include "CFontFolderViewCB.h"
47#include "CFontBackgroundMenu.h"
48
49#define FONT_HIVE HKEY_LOCAL_MACHINE
50#define FONT_KEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
51
54 REFIID riid, LPVOID* ppvOut);
55
56inline BOOL IsFontDotExt(LPCWSTR pchDotExt)
57{
58 static const LPCWSTR array[] =
59 {
60 L".ttf", L".ttc", L".otf", L".otc", L".fon", L".fnt", NULL
61 };
62 for (const LPCWSTR *pp = array; *pp; ++pp)
63 {
64 if (!StrCmpIW(*pp, pchDotExt))
65 return TRUE;
66 }
67 return FALSE;
68}
69
71
74 _In_ PCWSTR pszFontPath,
75 _In_ PCWSTR pszFontsDir,
76 _In_ HKEY hkeyFonts);
77
79 _In_ PCWSTR pszFontPath,
80 _Out_ CStringW& strFontName);
81
82BOOL CheckDropFontFiles(HDROP hDrop);
85
89 CFontExt* pFontExt,
90 HWND hwnd,
91 IShellFolder* psf,
92 IContextMenu** ppcm);
93
94LSTATUS AddClassKeyToArray(const WCHAR* szClass, HKEY* array, UINT* cKeys);
95void CloseRegKeyArray(HKEY* array, UINT cKeys);
96
98{
101
104 operator HKEY*() { return hKeys; }
105 operator UINT*() { return &cKeys; }
106 operator UINT() { return cKeys; }
108};
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define APIENTRY
Definition: api.h:79
const GUID CLSID_CFontExt
Definition: fontext.cpp:13
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
HRESULT APIENTRY CFontBackgroundMenu_Create(CFontExt *pFontExt, HWND hwnd, IShellFolder *psf, IContextMenu **ppcm)
struct tagINSTALL_FONT_DATA * PINSTALL_FONT_DATA
HRESULT InstallFontsFromDataObject(HWND hwndView, IDataObject *pDataObj)
Definition: fontext.cpp:390
HRESULT InstallFontFiles(_Inout_ PINSTALL_FONT_DATA pData)
Definition: fontext.cpp:125
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: fontext.cpp:109
HRESULT DoGetFontTitle(_In_ PCWSTR pszFontPath, _Out_ CStringW &strFontName)
void CloseRegKeyArray(HKEY *array, UINT cKeys)
Definition: fontext.cpp:103
BOOL CheckDropFontFiles(HDROP hDrop)
Definition: fontext.cpp:289
BOOL IsFontDotExt(LPCWSTR pchDotExt)
Definition: precomp.h:56
struct tagINSTALL_FONT_DATA INSTALL_FONT_DATA
HRESULT _CEnumFonts_CreateInstance(CFontExt *zip, DWORD flags, REFIID riid, LPVOID *ppvOut)
Definition: CEnumFonts.cpp:97
BOOL CheckDataObject(IDataObject *pDataObj)
Definition: fontext.cpp:308
HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, LPVOID *ppvOut)
Definition: CDataObject.cpp:36
HRESULT DoInstallFontFile(_In_ PCWSTR pszFontPath, _In_ PCWSTR pszFontsDir, _In_ HKEY hkeyFonts)
Definition: fontext.cpp:181
int WINAPI StrCmpIW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:456
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
unsigned int UINT
Definition: ndis.h:50
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
HKEY hKeys[16]
Definition: precomp.h:99
HKEY & operator[](SIZE_T i)
Definition: precomp.h:107
Definition: undname.c:54
Definition: fci.c:116
PCUIDLIST_RELATIVE * apidl
Definition: precomp.h:39
LPCITEMIDLIST pidlParent
Definition: precomp.h:38
IDataObject * pDataObj
Definition: precomp.h:32
HRESULT hrResult
Definition: precomp.h:33
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180