forked from crypto2011/IDR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Highlight.h
124 lines (105 loc) · 3.88 KB
/
Highlight.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//////////////////////////
//Highlight SDK //
//Version: 1.2.0 //
//Date : 03.03.2015 //
//Author : Error13Tracer//
//////////////////////////
#ifndef HighlightH
#define HighlightH
const LPCSTR HighlightDll = "Highlight.dll";
//ßçûêè
const ID_UNKNOWN = 0xFFFFFFFF;
const ID_DELPHI = 0x00000000;
const ID_ASM = 0x00000001;
const ID_HEX = 0x00000002;
//Òåìà èç êîíôèãà
const ID_CFG_THEME = 0xFFFFFFFF;
//Óñòàíîâêà ïîäñâåòêè
typedef DWORD (__stdcall * PCreateHighlight) (HWND, DWORD);
//Õåíäë ListBox
//ßçûê ïîäñâåòêè
//Âîçâðàò - ID êîíòðîëà
//Îòðèñîâêà â ñîáûòèè OnDrawItem
typedef void (__stdcall * PHighlightDrawItem)(DWORD, int, TRect, bool);
//ID êîíòðîëà
//Index
//Rect
//Lighten (true - îñâåòëåíèå, false - ðèñîâàòü ñîãëàñíî òåìå)
//Ïåðåðèñîâêà êîíòðîëà
typedef void (__stdcall * PHighlightRedraw) (DWORD);
//ID êîíòðîëà
//Óñòàíîâêà ÿçûêà
typedef void (__stdcall * PChangeLanguage) (DWORD, DWORD);
//ID êîíòðîëà
//ßçûê
//Óñòàíîâêà òåìû
typedef void (__stdcall * PChangeTheme) (DWORD, DWORD);
//ID êîíòðîëà
//ID òåìû
//Óñòàíîâêà ãëàáàëüíîé òåìû ñ ñîõðàíåíèåì â êîíôèã
typedef void (__stdcall * PChangeGlobalTheme)(DWORD, DWORD);
//ßçûê
//ID òåìû
//Óäàëåíèå ïîäñâåòêè
typedef void (__stdcall * PDeleteHighlight) (DWORD);
//ID êîíòðîëà
//ID òåêóùåé òåìû
typedef DWORD (__stdcall * PGetThemeId) (DWORD);
//ID êîíòðîëà
//Âîçâðàò - ID òåìû
//Êîë-âî òåì äëÿ ÿçûêà
typedef DWORD (__stdcall * PGetThemesCount) (DWORD);
//ßçûê
//Âîçâðàò - êîë-âî òåì
//Èìÿ òåìû
typedef DWORD (__stdcall * PGetThemeName) (DWORD, DWORD, LPCSTR, DWORD);
//ßçûê
//ID òåìû
//Áóôåð
//Ðàçìåð áóôåðà
//Âîçâðàò - äëèíà èìåíè òåìû; Áóôåð - èìÿ òåìû
//Äèàëîã íàñòðîåê
typedef int (__stdcall * PSettingsShowModal)(HWND);
//Õåíäë îêíà, ïîâåðõ êîòîðîãî îòîáðàæàòü
//Âîçâðàò - ModalResult
PCreateHighlight CreateHighlight;
PHighlightDrawItem HighlightDrawItem;
PHighlightRedraw HighlightRedraw;
PChangeLanguage ChangeLanguage;
PChangeTheme ChangeTheme;
PChangeGlobalTheme ChangeGlobalTheme;
PDeleteHighlight DeleteHighlight;
PGetThemeId GetThemeId;
PGetThemesCount GetThemesCount;
PGetThemeName GetThemeName;
PSettingsShowModal SettingsShowModal;
HMODULE hHighlight = NULL;
static bool InitHighlight(){
if (hHighlight == NULL){
hHighlight = LoadLibraryA(HighlightDll);
}
if (hHighlight != NULL) {
CreateHighlight = (PCreateHighlight) GetProcAddress(hHighlight, /*0x01*/"CreateHighlight@8");
HighlightDrawItem = (PHighlightDrawItem)GetProcAddress(hHighlight, /*0x02*/"HighlightDrawItem@16");
HighlightRedraw = (PHighlightRedraw) GetProcAddress(hHighlight, /*0x03*/"HighlightRedraw@4");
ChangeLanguage = (PChangeLanguage) GetProcAddress(hHighlight, /*0x04*/"ChangeLanguage@8");
ChangeTheme = (PChangeTheme) GetProcAddress(hHighlight, /*0x05*/"ChangeTheme@8");
ChangeGlobalTheme = (PChangeGlobalTheme)GetProcAddress(hHighlight, /*0x06*/"ChangeGlobalTheme@8");
DeleteHighlight = (PDeleteHighlight) GetProcAddress(hHighlight, /*0x07*/"DeleteHighlight@4");
GetThemeId = (PGetThemeId) GetProcAddress(hHighlight, /*0x08*/"GetThemeId@4");
GetThemesCount = (PGetThemesCount) GetProcAddress(hHighlight, /*0x09*/"GetThemesCount@4");
GetThemeName = (PGetThemeName) GetProcAddress(hHighlight, /*0x0A*/"GetThemeName@16");
SettingsShowModal = (PSettingsShowModal)GetProcAddress(hHighlight, /*0x0B*/"SettingsShowModal@4");
return ((CreateHighlight != NULL)&(ChangeLanguage != NULL)&(ChangeTheme != NULL)&
(GetThemesCount != NULL)&(DeleteHighlight != NULL)&(HighlightDrawItem != NULL)&
(HighlightRedraw != NULL)&(GetThemeName != NULL)&(ChangeGlobalTheme != NULL)&
(GetThemeId != NULL)&(SettingsShowModal != NULL));
}else
return false;
}
static void FreeHighlight(){
if (hHighlight != 0) {
FreeLibrary(hHighlight);
}
}
#endif