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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
#ifndef TTB_COMMON_H
#define TTB_COMMON_H
#define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <commctrl.h>
#include <time.h>
#include <stddef.h>
#include <process.h>
#include <math.h>
#include <vsstyle.h>
#include "win2k.h"
#include "newpluginapi.h"
#include "m_system.h"
#include "m_system_cpp.h"
#include "m_database.h"
#include "m_clist.h"
#include "m_skin.h"
#include "m_utils.h"
#include "m_cluiframes.h"
#include "m_clui.h"
#include "m_clc.h"
#include "m_langpack.h"
#include "m_options.h"
#include "resource.h"
#include "m_protocols.h"
#include "m_protosvc.h"
#include "m_toptoolbar.h"
#include "m_button.h"
#include "m_icolib.h"
#include "BkgrCfg.h"
#define TTB_OPTDIR "TopToolBar"
#define TTBDEFAULT_BKBMPUSE CLB_STRETCH
#define TTBDEFAULT_BKCOLOUR GetSysColor(COLOR_3DFACE)
#define TTBDEFAULT_USEBITMAP 0
#define TTBDEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
int TTBOptInit(WPARAM wParam, LPARAM lParam);
//append string
char __inline *AS(char *str, const char *setting, char *addstr);
int ttbOptionsChanged();
int ArrangeButtons();
int RecreateWindows();
struct TopButtonInt
{
HWND hwnd;
HWND hwndTip;
int id;
BOOL bPushed;
int dwFlags;
int x, y;
HBITMAP hbBitmapUp, hbBitmapDown;
HBITMAP hbDefBitmapUp, hbDefBitmapDown;
HBITMAP hbWBordBitmapUp, hbWBordBitmapDown;
HICON hIconUp, hIconDn;
char *pszServiceUp, *pszServiceDown;
char *name;
TCHAR *tooltip;
LPARAM lParamUp;
WPARAM wParamUp;
LPARAM lParamDown;
WPARAM wParamDown;
WORD arrangedpos;
TCHAR *UserDefinedbmUp;
TCHAR *UserDefinedbmDown;
};
struct SortData
{
int oldpos;
int arrangeval;
};
#define MAX_BUTTONS 64
//#define BUTTWIDTH 20
//#define BUTTHEIGHT 16
#define SEPWIDTH 3
struct ButtonOptData
{
char *name;
int pos;
bool show;
};
extern bool OptionsOpened, UseIcoLib, StopArrange;
extern HWND OptionshWnd;
extern HANDLE hHookTTBModuleLoaded;
extern HINSTANCE hInst;
extern LIST<void> arHooks, arServices;
int OptionsPageRebuild();
void lockbut();
void ulockbut();
//return - 0 success, -1 on error
#define TTB_ADDSEPARATOR "TTB/AddSeparator"
//wparam sepid
#define TTB_REMOVESEPARATOR "TTB/RemoveSeparator"
//append string
char *AS(char *str, const char *setting, char *addstr)
{
if (str != NULL) {
strcpy(str, setting);
strcat(str, addstr);
}
return str;
}
#define TTB_LAUNCHSERVICE "TTB/LaunchSerice"
//wparam -id
//lparam &LBTOPT
#define TTB_MODIFYLBUTTON "TTB/ModifyLButton"
//wparam -id
//lparam &LBTOPT
#define TTB_GETLBUTTON "TTB/GetLButton"
#define TTB_ADDLBUTTON "TTB/AddLButton"
#define TTB_REMOVELBUTTON "TTB/RemoveLButton"
#define MYMIRANDABUTTONCLASS _T("MyMIRANDABUTTONCLASS")
int LoadInternalButtons( HWND );
int UnLoadInternalButtons( void );
int LoadButtonModule( void );
int UnloadButtonModule( void );
int LoadToolbarModule( void );
int UnloadToolbarModule( void );
int LoadAllSeparators( void );
int SetAllBitmaps( void );
int SaveAllLButs( void );
int SaveAllButtonsOptions( void );
int SaveAllSeparators( void );
int InitLBut();
int UnInitLBut();
void lockbut();
void ulockbut();
int applyuserbitmaps( int );
INT_PTR TTBAddButton(WPARAM, LPARAM);
INT_PTR TTBRemoveButton(WPARAM, LPARAM);
INT_PTR DeleteLBut(WPARAM, LPARAM);
INT_PTR ModifyLButton(WPARAM, LPARAM);
INT_PTR GetLButton(WPARAM, LPARAM);
INT_PTR InsertNewFreeSeparator(WPARAM, LPARAM);
INT_PTR DeleteSeparator(WPARAM, LPARAM);
int OnModulesLoad(WPARAM, LPARAM);
INT_PTR InsertLBut(int id);
struct LBUTOPT
{
int hframe;
TCHAR *lpath;
char *name;
};
#define BM_SETPRIVATEICON (WM_USER + 6)
#define BM_SETIMLICON (WM_USER + 7)
#define UseIcoLibDefaultValue 0
#define UseMirandaButtonClassDefaultValue 1
#endif
|