ReactOS 0.4.16-dev-1028-g8602629
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
30#include "resource.h"
31#include "fontpidl.hpp"
32#include "CFontCache.hpp"
33#include "CFontExt.hpp"
34
35#define FONT_HIVE HKEY_LOCAL_MACHINE
36#define FONT_KEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
37
40 IShellFolder *psf, REFIID riid, LPVOID* ppvOut);
42 REFIID riid, LPVOID* ppvOut);
43
44inline BOOL IsFontDotExt(LPCWSTR pchDotExt)
45{
46 static const LPCWSTR array[] =
47 {
48 L".ttf", L".ttc", L".otf", L".otc", L".fon", L".fnt", NULL
49 };
50 for (const LPCWSTR *pp = array; *pp; ++pp)
51 {
52 if (!_wcsicmp(*pp, pchDotExt))
53 return TRUE;
54 }
55 return FALSE;
56}
57
60 _Out_ CStringW& strMessage,
61 _In_ PCUIDLIST_ABSOLUTE pidlParent,
62 _In_ UINT cidl,
64
67 _Out_ CStringW& strMsg,
68 _In_ PCWSTR pszFontPath,
69 _In_ PCWSTR pszFontsDir,
70 _In_ HKEY hkeyFonts);
71
73 _In_ PCWSTR pszFontPath,
74 _Out_ CStringW& strFontName);
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT _CFontMenu_CreateInstance(HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, REFIID riid, LPVOID *ppvOut)
Definition: CFontMenu.cpp:111
HRESULT DoInstallFontFile(_Out_ CStringW &strMsg, _In_ PCWSTR pszFontPath, _In_ PCWSTR pszFontsDir, _In_ HKEY hkeyFonts)
Definition: fontext.cpp:150
const GUID CLSID_CFontExt
Definition: fontext.cpp:13
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
HRESULT DoGetFontTitle(_In_ PCWSTR pszFontPath, _Out_ CStringW &strFontName)
BOOL IsFontDotExt(LPCWSTR pchDotExt)
Definition: precomp.h:44
HRESULT _CEnumFonts_CreateInstance(CFontExt *zip, DWORD flags, REFIID riid, LPVOID *ppvOut)
Definition: CEnumFonts.cpp:97
HRESULT InstallFontFiles(_Out_ CStringW &strMessage, _In_ PCUIDLIST_ABSOLUTE pidlParent, _In_ UINT cidl, _In_ PCUITEMID_CHILD_ARRAY apidl)
Definition: fontext.cpp:104
HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, LPVOID *ppvOut)
Definition: CDataObject.cpp:36
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
REFIID riid
Definition: atlbase.h:39
unsigned int UINT
Definition: ndis.h:50
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
Definition: fci.c:116
const uint16_t * PCWSTR
Definition: typedefs.h:57
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185