-
Notifications
You must be signed in to change notification settings - Fork 444
/
gdiPlusFlat2.cpp
39 lines (36 loc) · 1.62 KB
/
gdiPlusFlat2.cpp
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
#include "gdiPlusFlat2.h"
#include <tchar.h>
GdipDrawString pfnGdipDrawString = NULL;
GdipGetBrushType pfnGdipGetBrushType = NULL;
GdipGetDC pfnGdipGetDC = NULL;
GdipGetLogFontW pfnGdipGetLogFontW = NULL;
GdipGetSolidFillColor pfnGdipGetSolidFillColor = NULL;
GdipGetStringFormatAlign pfnGdipGetStringFormatAlign = NULL;
GdipGetStringFormatHotkeyPrefix pfnGdipGetStringFormatHotkeyPrefix = NULL;
GdipGetStringFormatTrimming pfnGdipGetStringFormatTrimming = NULL;
GdipReleaseDC pfnGdipReleaseDC = NULL;
bool InitGdiplusFuncs(){
static bool bInited = false;
if (!bInited)
{
bInited = true;
HMODULE hGdiplusDll = GetModuleHandle(_T("Gdiplus.dll"));
if (hGdiplusDll)
{
pfnGdipDrawString = (GdipDrawString)GetProcAddress(hGdiplusDll, "GdipDrawString");
pfnGdipGetBrushType = (GdipGetBrushType)GetProcAddress(hGdiplusDll, "GdipGetBrushType");
pfnGdipGetDC = (GdipGetDC)GetProcAddress(hGdiplusDll, "GdipGetDC");
pfnGdipGetLogFontW = (GdipGetLogFontW)GetProcAddress(hGdiplusDll, "GdipGetLogFontW");
pfnGdipGetSolidFillColor = (GdipGetSolidFillColor)GetProcAddress(hGdiplusDll, "GdipGetSolidFillColor");
pfnGdipGetStringFormatAlign = (GdipGetStringFormatAlign)GetProcAddress(hGdiplusDll, "GdipGetStringFormatAlign");
pfnGdipGetStringFormatHotkeyPrefix = (GdipGetStringFormatHotkeyPrefix)GetProcAddress(hGdiplusDll, "GdipGetStringFormatHotkeyPrefix");
pfnGdipGetStringFormatTrimming = (GdipGetStringFormatTrimming)GetProcAddress(hGdiplusDll, "GdipGetStringFormatTrimming");
pfnGdipReleaseDC = (GdipReleaseDC)GetProcAddress(hGdiplusDll, "GdipReleaseDC");
return true;
}
else
return false;
}
else
return true;
}