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
185
|
/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
* Win16 Toolbar by Vince Negri - External Header
* (Based on MS Sample Code)
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
*/
//
// Button Structure
//
typedef struct tagTBBUTTON
{
int iBitmap; // index into bitmap of this button's picture
int idCommand; // WM_COMMAND menu ID that this button sends
BYTE fsState; // button's state
BYTE fsStyle; // button's style
} TBBUTTON;
typedef TBBUTTON NEAR* PTBBUTTON;
typedef TBBUTTON FAR* LPTBBUTTON;
typedef const TBBUTTON FAR* LPCTBBUTTON;
//
// Styles
//
#define TBSTYLE_BUTTON 0x00 // this entry is button
#define TBSTYLE_SEP 0x01 // this entry is a separator
#define TBSTYLE_CHECK 0x02 // this is a check button (it stays down)
#define TBSTYLE_GROUP 0x04 // this is a check button (it stays down)
#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) // this group is a member of a group radio group
//
// States
//
#define TBSTATE_CHECKED 0x01 // radio button is checked
#define TBSTATE_PRESSED 0x02 // button is being depressed (any style)
#define TBSTATE_ENABLED 0x04 // button is enabled
#define TBSTATE_HIDDEN 0x08 // button is hidden
#define TBSTATE_INDETERMINATE 0x10 // button is indeterminate
#define TBSTATE_SELECTED 0x20 // mouse hovering over button (for coolbar look)
typedef struct tagADJUSTINFO
{
TBBUTTON tbButton;
char szDescription[1];
} ADJUSTINFO;
typedef ADJUSTINFO NEAR* PADJUSTINFO;
typedef ADJUSTINFO FAR* LPADJUSTINFO;
HWND WINAPI CreateToolbar(HWND hwnd, DWORD ws, WORD wID, int nBitmaps,
HINSTANCE hBMInst, WORD wBMID,
LPCTBBUTTON lpButtons, int iNumButtons);
#define CMB_DISCARDABLE 0x01 // create bitmap as discardable
#define CMB_MASKED 0x02 // create image/mask pair in bitmap
#define TB_ENABLEBUTTON (WM_USER + 1)
// wParam: UINT, button ID
// lParam: BOOL LOWORD, enable if nonzero; HIWORD not used, 0
// return: not used
//
#define TB_CHECKBUTTON (WM_USER + 2)
// wParam: UINT, button ID
// lParam: BOOL LOWORD, check if nonzero; HIWORD not used, 0
// return: not used
//
#define TB_PRESSBUTTON (WM_USER + 3)
// wParam: UINT, button ID
// lParam: BOOL LOWORD, press if nonzero; HIWORD not used, 0
// return: not used
//
#define TB_HIDEBUTTON (WM_USER + 4)
// wParam: UINT, button ID
// lParam: BOOL LOWORD, hide if nonzero; HIWORD not used, 0
// return: not used
//
#define TB_INDETERMINATE (WM_USER + 5)
// wParam: UINT, button ID
// lParam: BOOL LOWORD, make indeterminate if nonzero; HIWORD not used, 0
// return: not used
//
#define TB_ISBUTTONENABLED (WM_USER + 9)
// wParam: UINT, button ID
// lParam: not used, 0
// return: BOOL LOWORD, enabled if nonzero; HIWORD not used
//
#define TB_ISBUTTONCHECKED (WM_USER + 10)
// wParam: UINT, button ID
// lParam: not used, 0
// return: BOOL LOWORD, checked if nonzero; HIWORD not used
//
#define TB_ISBUTTONPRESSED (WM_USER + 11)
// wParam: UINT, button ID
// lParam: not used, 0
// return: BOOL LOWORD, pressed if nonzero; HIWORD not used
//
#define TB_ISBUTTONHIDDEN (WM_USER + 12)
// wParam: UINT, button ID
// lParam: not used, 0
// return: BOOL LOWORD, hidden if nonzero; HIWORD not used
//
#define TB_ISBUTTONINDETERMINATE (WM_USER + 13)
// wParam: UINT, button ID
// lParam: not used, 0
// return: BOOL LOWORD, indeterminate if nonzero; HIWORD not used
//
#define TB_SETSTATE (WM_USER + 17)
// wParam: UINT, button ID
// lParam: UINT LOWORD, state bits; HIWORD not used, 0
// return: not used
//
#define TB_GETSTATE (WM_USER + 18)
// wParam: UINT, button ID
// lParam: not used, 0
// return: UINT LOWORD, state bits; HIWORD not used
//
#define TB_ADDBITMAP (WM_USER + 19)
// wParam: UINT, number of button graphics in bitmap
// lParam: one of:
// HINSTANCE LOWORD, module handle; UINT HIWORD, resource id
// HINSTANCE LOWORD, NULL; HBITMAP HIWORD, bitmap handle
// return: one of:
// int LOWORD, index for first new button; HIWORD not used
// int LOWORD, -1 indicating error; HIWORD not used
//
#define TB_ADDBUTTONS (WM_USER + 20)
// wParam: UINT, number of buttons to add
// lParam: LPTBBUTTON, pointer to array of TBBUTTON structures
// return: not used
//
#define TB_INSERTBUTTON (WM_USER + 21)
// wParam: UINT, index for insertion (appended if index doesn't exist)
// lParam: LPTBBUTTON, pointer to one TBBUTTON structure
// return: not used
//
#define TB_DELETEBUTTON (WM_USER + 22)
// wParam: UINT, index of button to delete
// lParam: not used, 0
// return: not used
//
#define TB_GETBUTTON (WM_USER + 23)
// wParam: UINT, index of button to get
// lParam: LPTBBUTTON, pointer to TBBUTTON buffer to receive button
// return: not used
//
#define TB_BUTTONCOUNT (WM_USER + 24)
// wParam: not used, 0
// lParam: not used, 0
// return: UINT LOWORD, number of buttons; HIWORD not used
//
#define TB_COMMANDTOINDEX (WM_USER + 25)
// wParam: UINT, command id
// lParam: not used, 0
// return: UINT LOWORD, index of button (-1 if command not found);
// HIWORD not used
//
#define TBN_BEGINDRAG 0x0201
#define TBN_ENDDRAG 0x0203
|