-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSuiteExterns.h
54 lines (45 loc) · 2.39 KB
/
SuiteExterns.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef SUITEEXTERNS_H
#define SUITEEXTERNS_H
#include <memory>
#include <windows.h>
#define SECURITY_WIN32
#include <security.h>
#include <commctrl.h>
//Tydefing few things here for WICConvertBitmapSource so not to include whole wincodec.h with all it's GUIDs
typedef interface IWICBitmapSource IWICBitmapSource;
typedef REFGUID REFWICPixelFormatGUID;
class SuiteExterns {
private:
static std::unique_ptr<SuiteExterns> instance;
HMODULE hShell32;
HMODULE hComctl32;
HMODULE hSecur32;
HMODULE hShfolder;
HMODULE hUser32;
HMODULE hWincodec;
HMODULE hAdvapi32;
void LoadFunctions();
void UnloadFunctions();
SuiteExterns();
public:
~SuiteExterns();
SuiteExterns(const SuiteExterns&)=delete; //Get rid of default copy constructor
SuiteExterns& operator=(const SuiteExterns&)=delete; //Get rid of default copy assignment operator
SuiteExterns(const SuiteExterns&&)=delete; //Get rid of default move constructor
SuiteExterns& operator=(const SuiteExterns&&)=delete; //Get rid of default move assignment operator
static bool MakeInstance();
};
typedef HRESULT (WINAPI *pSHGetFolderPath)(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
typedef BOOL (WINAPI *pSHGetSpecialFolderPath)(HWND hwndOwner, LPWSTR lpszPath, int csidl, BOOL fCreate);
typedef HRESULT (WINAPI *pTaskDialog)(HWND hWndParent, HINSTANCE hInstance, PCWSTR pszWindowTitle, PCWSTR pszMainInstruction, PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, PCWSTR pszIcon, int *pnButton);
typedef BOOLEAN (WINAPI *pGetUserNameEx)(EXTENDED_NAME_FORMAT NameFormat, LPTSTR lpNameBuffer, PULONG lpnSize);
typedef int (WINAPI *pSHCreateDirectoryEx)(HWND hwnd, LPCWSTR pszPath, const SECURITY_ATTRIBUTES *psa);
typedef int (WINAPI *pSHCreateDirectory)(HWND hwnd, LPCWSTR pszPath);
typedef HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID siid, UINT uFlags, SHSTOCKICONINFO *psii);
typedef BOOL (WINAPI *pChangeWindowMessageFilter)(UINT message, DWORD dwFlag);
typedef HRESULT (WINAPI *pWICConvertBitmapSource)(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst);
typedef BOOL (WINAPI *pSetMenuInfo)(HMENU hmenu, LPCMENUINFO lpcmi);
typedef BOOL (WINAPI *pGetMenuInfo)(HMENU hmenu, LPCMENUINFO lpcmi);
typedef BOOL (WINAPI *pFlashWindowEx)(PFLASHWINFO pfwi);
typedef BOOL (WINAPI *pCheckTokenMembership)(HANDLE TokenHandle, PSID SidToCheck, PBOOL IsMember);
#endif //SUITEEXTERNS_H