-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolbar.h
45 lines (42 loc) · 1003 Bytes
/
toolbar.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
#ifndef _TOOLBAR_H_
#define _TOOLBAR_H_
#include <windows.h>
#include <commctrl.h>
class ToolBar
{
public:
ToolBar(HWND hPrtWin)
{
_hPrtWin = hPrtWin;
_idToolBar = NULL;
_hToolBar = NULL;
_himglist = NULL;
};
~ToolBar(){
ImageList_Destroy(_himglist);
};
HWND GetToolbar()
{
return _hToolBar;
};
HWND CreateToolbarInBand(UINT toolbarid);
HWND CreateToolbar(UINT toolbarid);
void AutoSizeToolBar();
//long GetButtonData(int item);
//long SetButtonData(int item,long data);
bool AddToolBarButtons(UINT uNumButtons,LPTBBUTTON lpButtons);
bool InsertToolBarButtons(UINT iButton,LPTBBUTTON lpButton);
void SetButtonState(int id,int state);
bool CreateImgList(UINT imgcount,int x,int y);
bool AppendIconToImgList(HICON hicon);
int AddStrings(LPSTR str);
int GetCount();
BOOL GetButtonRect(int item,RECT *pRc);
private:
HIMAGELIST _himglist;
UINT _idToolBar;
HWND _hPrtWin;
HWND _hToolBar;
};
typedef ToolBar* PToolBar;
#endif