<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Eigene Buttons zu Tabbar hinzufügen]]></title><description><![CDATA[<p>Hi ich habe folgenden code wo ich ein Tabbar erstelle und die systembuttons hinzufüge nun möchte ich gerne noch eigene Buttons hinzufügen bekomm das allerdings nicht ganz hin.<br />
Hier mein code</p>
<pre><code>hwndToolbar = CreateWindowEx(WS_EX_TOOLWINDOW, TOOLBARCLASSNAME, NULL,
                         WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
						 CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, 
                         0, 0, 200, 30, hwnd, NULL, ghInstance, NULL); 

			SendMessage(hwndToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); 

			tbAddBmp.hInst = HINST_COMMCTRL; 
			tbAddBmp.nID = IDB_STD_SMALL_COLOR; 
			SendMessage(hwndToolbar, TB_ADDBITMAP, 0, (WPARAM)&amp;tbAddBmp); 

			tbb[0].iBitmap = STD_FILENEW; 
			tbb[0].idCommand = ID_TOLLBAR_NEW; 
			tbb[0].fsState = TBSTATE_ENABLED; 
			tbb[0].fsStyle = TBSTYLE_BUTTON; 
			tbb[0].dwData = 0; 
			tbb[0].iString = 0;

			tbb[1].iBitmap = STD_FILEOPEN; 
			tbb[1].idCommand = ID_TOOLBAR_OPEN; 
			tbb[1].fsState = TBSTATE_ENABLED; 
			tbb[1].fsStyle = TBSTYLE_BUTTON; 
			tbb[1].dwData = 0; 
			tbb[1].iString = 0;

			tbb[2].iBitmap = STD_FILESAVE; 
			tbb[2].idCommand = ID_TOOLBAR_SAVE; 
			tbb[2].fsState = TBSTATE_ENABLED; 
			tbb[2].fsStyle = TBSTYLE_BUTTON;  
			tbb[2].dwData = 0; 
			tbb[2].iString = 0;

			tbb[3].iBitmap = 0; 
			tbb[3].idCommand = -1; 
			tbb[3].fsState = TBSTATE_ENABLED; 
			tbb[3].fsStyle = TBSTYLE_SEP;    
			tbb[3].dwData = 0; 
			tbb[3].iString = 0; 

			tbb[4].iBitmap = STD_UNDO; 
			tbb[4].idCommand = ID_TOOLBAR_UNDO; 
			tbb[4].fsState = TBSTATE_ENABLED; 
			tbb[4].fsStyle = TBSTYLE_BUTTON; 
			tbb[4].dwData = 0; 
			tbb[4].iString = 0;

			tbb[5].iBitmap = STD_REDOW; 
			tbb[5].idCommand = ID_TOOLBAR_REDOW; 
			tbb[5].fsState = TBSTATE_ENABLED; 
			tbb[5].fsStyle = TBSTYLE_BUTTON; 
			tbb[5].dwData = 0; 
			tbb[5].iString = 0;

			tbb[6].iBitmap = 0; 
			tbb[6].idCommand = -1; 
			tbb[6].fsState = TBSTATE_ENABLED; 
			tbb[6].fsStyle = TBSTYLE_SEP; 
			tbb[6].dwData = 0; 
			tbb[6].iString = 0; 

			tbb[7].iBitmap = STD_FIND ; 
			tbb[7].idCommand = ID_TOOLBAR_FIND; 
			tbb[7].fsState = TBSTATE_ENABLED; 
			tbb[7].fsStyle = TBSTYLE_BUTTON; 
			tbb[7].dwData = 0; 
			tbb[7].iString = 0;

			tbb[8].iBitmap = STD_HELP; 
			tbb[8].idCommand = ID_TOOLBAR_HELP; 
			tbb[8].fsState = TBSTATE_ENABLED; 
			tbb[8].fsStyle = TBSTYLE_BUTTON; 
			tbb[8].dwData = 0; 
			tbb[8].iString = 0;

			SendMessage(hwndToolbar, TB_ADDBUTTONS, 9, (LPARAM)(LPTBBUTTON)&amp;tbb);
</code></pre>
<p>habe dann das versucht allerdings bekomm ich da ein Button aber das Bitmap wird nicht angezeigt</p>
<pre><code>tbb[9].iBitmap = IDB_TEST; 
			tbb[9].idCommand = ID_TEST; 
			tbb[9].fsState = TBSTATE_ENABLED; 
			tbb[9].fsStyle = TBSTYLE_BUTTON; 
			tbb[9].dwData = 0; 
			tbb[9].iString = 0;

			SendMessage(hwndToolbar, TB_ADDBUTTONS, 10, (LPARAM)(LPTBBUTTON)&amp;tbb);
</code></pre>
<p>Ich hoffe ihr könnt mir helfen?<br />
MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/93217/eigene-buttons-zu-tabbar-hinzufügen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 02:31:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93217.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Nov 2004 10:53:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Eigene Buttons zu Tabbar hinzufügen on Sat, 27 Nov 2004 10:53:55 GMT]]></title><description><![CDATA[<p>Hi ich habe folgenden code wo ich ein Tabbar erstelle und die systembuttons hinzufüge nun möchte ich gerne noch eigene Buttons hinzufügen bekomm das allerdings nicht ganz hin.<br />
Hier mein code</p>
<pre><code>hwndToolbar = CreateWindowEx(WS_EX_TOOLWINDOW, TOOLBARCLASSNAME, NULL,
                         WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
						 CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, 
                         0, 0, 200, 30, hwnd, NULL, ghInstance, NULL); 

			SendMessage(hwndToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); 

			tbAddBmp.hInst = HINST_COMMCTRL; 
			tbAddBmp.nID = IDB_STD_SMALL_COLOR; 
			SendMessage(hwndToolbar, TB_ADDBITMAP, 0, (WPARAM)&amp;tbAddBmp); 

			tbb[0].iBitmap = STD_FILENEW; 
			tbb[0].idCommand = ID_TOLLBAR_NEW; 
			tbb[0].fsState = TBSTATE_ENABLED; 
			tbb[0].fsStyle = TBSTYLE_BUTTON; 
			tbb[0].dwData = 0; 
			tbb[0].iString = 0;

			tbb[1].iBitmap = STD_FILEOPEN; 
			tbb[1].idCommand = ID_TOOLBAR_OPEN; 
			tbb[1].fsState = TBSTATE_ENABLED; 
			tbb[1].fsStyle = TBSTYLE_BUTTON; 
			tbb[1].dwData = 0; 
			tbb[1].iString = 0;

			tbb[2].iBitmap = STD_FILESAVE; 
			tbb[2].idCommand = ID_TOOLBAR_SAVE; 
			tbb[2].fsState = TBSTATE_ENABLED; 
			tbb[2].fsStyle = TBSTYLE_BUTTON;  
			tbb[2].dwData = 0; 
			tbb[2].iString = 0;

			tbb[3].iBitmap = 0; 
			tbb[3].idCommand = -1; 
			tbb[3].fsState = TBSTATE_ENABLED; 
			tbb[3].fsStyle = TBSTYLE_SEP;    
			tbb[3].dwData = 0; 
			tbb[3].iString = 0; 

			tbb[4].iBitmap = STD_UNDO; 
			tbb[4].idCommand = ID_TOOLBAR_UNDO; 
			tbb[4].fsState = TBSTATE_ENABLED; 
			tbb[4].fsStyle = TBSTYLE_BUTTON; 
			tbb[4].dwData = 0; 
			tbb[4].iString = 0;

			tbb[5].iBitmap = STD_REDOW; 
			tbb[5].idCommand = ID_TOOLBAR_REDOW; 
			tbb[5].fsState = TBSTATE_ENABLED; 
			tbb[5].fsStyle = TBSTYLE_BUTTON; 
			tbb[5].dwData = 0; 
			tbb[5].iString = 0;

			tbb[6].iBitmap = 0; 
			tbb[6].idCommand = -1; 
			tbb[6].fsState = TBSTATE_ENABLED; 
			tbb[6].fsStyle = TBSTYLE_SEP; 
			tbb[6].dwData = 0; 
			tbb[6].iString = 0; 

			tbb[7].iBitmap = STD_FIND ; 
			tbb[7].idCommand = ID_TOOLBAR_FIND; 
			tbb[7].fsState = TBSTATE_ENABLED; 
			tbb[7].fsStyle = TBSTYLE_BUTTON; 
			tbb[7].dwData = 0; 
			tbb[7].iString = 0;

			tbb[8].iBitmap = STD_HELP; 
			tbb[8].idCommand = ID_TOOLBAR_HELP; 
			tbb[8].fsState = TBSTATE_ENABLED; 
			tbb[8].fsStyle = TBSTYLE_BUTTON; 
			tbb[8].dwData = 0; 
			tbb[8].iString = 0;

			SendMessage(hwndToolbar, TB_ADDBUTTONS, 9, (LPARAM)(LPTBBUTTON)&amp;tbb);
</code></pre>
<p>habe dann das versucht allerdings bekomm ich da ein Button aber das Bitmap wird nicht angezeigt</p>
<pre><code>tbb[9].iBitmap = IDB_TEST; 
			tbb[9].idCommand = ID_TEST; 
			tbb[9].fsState = TBSTATE_ENABLED; 
			tbb[9].fsStyle = TBSTYLE_BUTTON; 
			tbb[9].dwData = 0; 
			tbb[9].iString = 0;

			SendMessage(hwndToolbar, TB_ADDBUTTONS, 10, (LPARAM)(LPTBBUTTON)&amp;tbb);
</code></pre>
<p>Ich hoffe ihr könnt mir helfen?<br />
MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660390</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Sat, 27 Nov 2004 10:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Buttons zu Tabbar hinzufügen on Sat, 27 Nov 2004 11:31:41 GMT]]></title><description><![CDATA[<p>MSDN schrieb:</p>
<blockquote>
<p><strong>iBitmap</strong><br />
Zero-based index of the button image. Set this member to I_IMAGECALLBACK, and the toolbar will send the TBN_GETDISPINFO notification to retrieve the image index when it is needed.</p>
</blockquote>
<p>MSDN schrieb:</p>
<blockquote>
<p><strong>Defining Button Images by Using Bitmaps</strong><br />
Each button in a toolbar can include a bitmapped image. A toolbar uses an internal list to store the information that it needs to draw the images. When you call the CreateToolbarEx function, you specify a monochrome or color bitmap that contains the initial images, and the toolbar adds the information to the internal list of images. You can add additional images later by using the TB_ADDBITMAP message.</p>
<p>Each image has a zero-based index. The first image added to the internal list has an index of 0, the second image has an index of 1, and so on. TB_ADDBITMAP adds images to the end of the list and returns the index of the first new image that it added. To associate the image with a button, you must send a TB_ADDBUTTONS message and specify the image's index after you add bitmaps to the internal image list.</p>
<p>Microsoft Windows assumes that all of a toolbar's bitmapped images are the same size. You specify the size when you create the toolbar by using CreateToolbarEx. If you use the CreateWindowEx function to create a toolbar, the size of the images is set to the default dimensions of 16 by 15 pixels. You can use the TB_SETBITMAPSIZE message to change the dimensions of the bitmapped images, but you must do so before adding any images to the internal list.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/660429</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660429</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sat, 27 Nov 2004 11:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Buttons zu Tabbar hinzufügen on Sat, 27 Nov 2004 13:42:40 GMT]]></title><description><![CDATA[<p>Ahh sorry habe gerade gesehen das im FAQ ein beitrag dazu gibt.<br />
Trotzdem danke<br />
MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660512</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Sat, 27 Nov 2004 13:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to Eigene Buttons zu Tabbar hinzufügen on Sat, 27 Nov 2004 21:48:24 GMT]]></title><description><![CDATA[<p>Also ich habe doch noch ein Problem. Ich beziehe mich jetzt auf das Faq.<br />
Ich kann jetzt ein Button hinzufügen aber nicht mehr.</p>
<pre><code>bit.hInst = HINST_COMMCTRL; 
			bit.nID = IDB_STD_SMALL_COLOR; 
			SendMessage(hwndToolbar, TB_ADDBITMAP, 0, (LPARAM)&amp;bit); 

			bit.hInst = NULL; 
			bit.nID   = (UINT_PTR)LoadImage(GetModuleHandle(NULL), 
				MAKEINTRESOURCE(IDB_PROGGEN), 
				IMAGE_BITMAP, 
				GetSystemMetrics(SM_CXSMICON), 
				GetSystemMetrics(SM_CYSMICON), 
				LR_DEFAULTCOLOR | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
			mypictures[9].iBitmap = SendMessage(hwndToolbar,TB_ADDBITMAP,0,(LPARAM)&amp;bit); 

			bit.hInst = NULL; 
			bit.nID   = (UINT_PTR)LoadImage(GetModuleHandle(NULL), 
				MAKEINTRESOURCE(IDB_KOMPILE), 
				IMAGE_BITMAP, 
				GetSystemMetrics(SM_CXSMICON), 
				GetSystemMetrics(SM_CYSMICON), 
				LR_DEFAULTCOLOR | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
			mypictures[10].iBitmap = SendMessage(hwndToolbar,TB_ADDBITMAP,0,(LPARAM)&amp;bit); 

			bit.hInst = NULL; 
			bit.nID   = (UINT_PTR)LoadImage(GetModuleHandle(NULL), 
				MAKEINTRESOURCE(IDB_INSERT), 
				IMAGE_BITMAP, 
				GetSystemMetrics(SM_CXSMICON), 
				GetSystemMetrics(SM_CYSMICON), 
				LR_DEFAULTCOLOR | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT);
			mypictures[11].iBitmap = SendMessage(hwndToolbar,TB_ADDBITMAP,0,(LPARAM)&amp;bit); 

			SendMessage (hwndToolbar, TB_ADDBUTTONS, (WPARAM)sizeof(mypictures)/sizeof(mypictures[0]), (LPARAM)(TBBUTTON*)&amp;mypictures);
</code></pre>
<p>So hab ich's versucht aber wie gesagt wird nur das erste angezeigt.<br />
Irgendwie wenn ich hier</p>
<pre><code>TBBUTTON mypictures[] = 
			{ 
				{STD_FILENEW , ID_TOLLBAR_NEW, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{STD_FILEOPEN, ID_TOOLBAR_OPEN, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{STD_FILESAVE, ID_TOOLBAR_SAVE, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 

				{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, 
				{STD_UNDO, ID_TOOLBAR_UNDO, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{STD_REDOW, ID_TOOLBAR_REDOW, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, 
				{STD_FIND, ID_TOOLBAR_FIND, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{STD_HELP, ID_TOOLBAR_HELP, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 

				{0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, 

				{0, 0, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{0, 0, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0}, 
				{0, 0, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE | TBSTYLE_BUTTON, 0, 0} 

			};
</code></pre>
<p>Halt hinten noch son Seperator reinmach wird nur ein halber angezeigt und wenn ich 2 reinmach wird garnichts mehr angezeigt.<br />
Hoffe ihr wisst was.</p>
<p>MfG schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/660834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/660834</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Sat, 27 Nov 2004 21:48:24 GMT</pubDate></item></channel></rss>