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
|
#ifndef M_MSG_BUTTONSBAR_H__
#define M_MSG_BUTTONSBAR_H__
//////////////////////////////////////////////////////////////////////////
// Services
//
//////////////////////////////////////////////////////////////////////////
// Adding a button
//
// wParam = 0
// lParam = (BBButton *) &description
// Returns 0 on success, 1 otherwise
#define MS_BB_ADDBUTTON "TabSRMM/ButtonsBar/AddButton"
//////////////////////////////////////////////////////////////////////////
// Remove button
//
// wParam = 0
// lParam = (BBButton *) &description, only button ID and ModuleName used
// Returns 0 on success, 1 otherwise
#define MS_BB_REMOVEBUTTON "TabSRMM/ButtonsBar/RemoveButton"
//////////////////////////////////////////////////////////////////////////
// ModifyButton(global)
//
// wParam = 0
// lParam = (BBButton *) &description
// Returns 0 on success, 1 otherwise
#define MS_BB_MODIFYBUTTON "TabSRMM/ButtonsBar/ModifyButton"
#define BBSF_HIDDEN (1<<0)
#define BBSF_DISABLED (1<<1)
#define BBSF_PUSHED (1<<2)
#define BBSF_RELEASED (1<<3)
//////////////////////////////////////////////////////////////////////////
// GetButtonState(local)
//
// wParam = hContact
// lParam = (BBButton *) &description , only ModuleName and ID used
// Returns BBButton struct with BBSF_ bbbFlags:
// Returns 0 on success, 1 otherwise
#define MS_BB_GETBUTTONSTATE "TabSRMM/ButtonsBar/GetButtonState"
//////////////////////////////////////////////////////////////////////////
// SetButtonState (local)
//
// wParam = hContact
// lParam = (BBButton *) &description , ModuleName, ID,hIcon,Tooltip, and BBSF_ bbbFlags are used
// Returns 0 on success, 1 otherwise
#define MS_BB_SETBUTTONSTATE "TabSRMM/ButtonsBar/SetButtonState"
////////////////////////////////////////////////////////////////
//Events
//
///////////////////////////////////////////////////
// ToolBar loaded event
// wParam = 0;
// lParam = 0;
// This event will be send after module loaded and after each toolbar reset
// You should add your buttons on this event
#define ME_MSG_TOOLBARLOADED "TabSRMM/ButtonsBar/ModuleLoaded"
///////////////////////////////////////////////////
// ButtonClicked event
// wParam = (HANDLE)hContact;
// lParam = (CustomButtonClickData *)&CustomButtonClickData;
// catch to show a popup menu, etc.
#define ME_MSG_BUTTONPRESSED "TabSRMM/ButtonsBar/ButtonPressed"
//event flags
#define BBCF_RIGHTBUTTON (1<<0)
#define BBCF_SHIFTPRESSED (1<<1)
#define BBCF_CONTROLPRESSED (1<<2)
#define BBCF_ARROWCLICKED (1<<3)
typedef struct {
int cbSize;
POINT pt; // screen coordinates for menus
char* pszModule; // button owners name
DWORD dwButtonId; // registered button ID
HWND hwndFrom; // button parents HWND
MCONTACT hContact;
DWORD flags; // BBCF_ flags
} CustomButtonClickData;
//button flags
#define BBBF_DISABLED (1<<0)
#define BBBF_HIDDEN (1<<1)
#define BBBF_ISPUSHBUTTON (1<<2)
#define BBBF_ISARROWBUTTON (1<<3)
#define BBBF_ISCHATBUTTON (1<<4)
#define BBBF_ISIMBUTTON (1<<5)
#define BBBF_ISLSIDEBUTTON (1<<6)
#define BBBF_ISRSIDEBUTTON (1<<7)
#define BBBF_CANBEHIDDEN (1<<8)
#define BBBF_ISDUMMYBUTTON (1<<9)
#define BBBF_ANSITOOLTIP (1<<10)
#define BBBF_CREATEBYID (1<<11) //only for tabsrmm internal use
typedef struct _tagBBButton
{
int cbSize; // size of structure
DWORD dwButtonID; // your button ID, will be combined with pszModuleName for storing settings, etc...
char* pszModuleName; //module name without spaces and underline symbols (e.g. "tabsrmm")
union{
char* pszTooltip; //button's tooltip
TCHAR* ptszTooltip;
};
DWORD dwDefPos; // default order pos of button, counted from window edge (left or right)
// use value >100, because internal buttons using 10,20,30... 80, etc
int iButtonWidth; // must be 0
DWORD bbbFlags; // combine of BBBF_ flags above
HANDLE hIcon; // Handle to icolib registered icon, it's better to register with pszSection = "TabSRMM/Toolbar"
}
BBButton;
#endif //M_MSG_BUTTONSBAR_H__
|