What am I doing wrong?

Hello, I'm trying to create a toolbar. Here's my code:
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
/* I could post whole code but it's 300+ lines... */
	case WM_CREATE: 
 // hinst    - instance of window
 // htb     - handle of toolbar
 //
		 //Tool bar
	
		TBADDBITMAP tbab;
		TBBUTTON tbb[5];
  
		htb=CreateWindowEx(0, TOOLBARCLASSNAME,NULL,
		WS_CHILD | WS_VISIBLE,
		CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
		hwnd, (HMENU)ID_TOOLBAR, hinst, NULL);
		SendMessage(htb, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);

	//	tbab.hInst = HINST_COMMCTRL;
	    tbab.hInst = hinst;
		tbab.nID = ICN_NXT;
		SendMessage(htb, TB_ADDBITMAP, 0, (LPARAM)&tbab);
		ZeroMemory(tbb, sizeof(tbb));


		tbb[0].iBitmap = 0;
		tbb[0].fsState = TBSTATE_ENABLED;
		tbb[0].fsStyle = TBSTYLE_BUTTON;
		tbb[0].idCommand = IDM_ABOUT;


		SendMessage(htb, TB_ADDBUTTONS, 1, (LPARAM)&tbb);



resource file:
1
2
3
4
//ICN_NXT is defined in other file; ICN_NXT==903
ICN_NXT BITMAP  "D:\\C++\\dskread\\sources\\dskread\\icons\\icon next sector.ico"
// ...

This is my first attempt to create toolbars with custom bitmaps. So what's wrong here?
Topic archived. No new replies allowed.