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
|
//Resources.RC//////////////////////
BITMAP1 BITMAP "bitmap1.bmp"
////////////////////////////////////
//Resources.h///////////////////////
#define bitmap1 101
////////////////////////////////////
//Main.cpp//////////////////////////
HWND toolbar;
TBBUTTON toolbar_button;
TBADDBITMAP toolbar_bitmap;
// A lot of code that creates the window
case WM_CREATE:
toolbar = CreateWindowEx(
0,
TOOLBARCLASSNAME,
NULL,
WS_CHILD|WS_VISIBLE,
0, 0, 0, 0,
hWnd,
(HMENU)TOOLBAR,
GetModuleHandle(NULL),
NULL
);
SendMessage(toolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
//The toolbar is created. Everything cool
toolbar_bitmap.hInst = HINST_COMMCTRL;
toolbar_bitmap.nID = BITMAP1;
toolbar_bitmap = SendMessage(toolbar, TB_ADDBITMAP, 1, (LPARAM)&toolbar_bitmap);
tb_username.iBitmap = 0;
tb_username.fsState = TBSTATE_ENABLED;
tb_username.fsStyle = TBSTYLE_BUTTON;
tb_username.idCommand = MNU_BUTTON1;
break;
////////////////////////////////////
|