<?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[Button Größe in Toolbar]]></title><description><![CDATA[<p>Ich versuche eine Tooolbar mit 6 Buttons der Größe 30x30 zu erstellen, das klappt auch soweit. Jedoch wird meine Bitmap Resource nicht richtig dargestellt. Das Bitmap wird in 16x16 große teile aufgeteilt und auf die Buttons gelegt, das Bitmap hat aber die Größe 30x180 = 6 Buttons. Hier ist mein Code:</p>
<pre><code>HWND ToolBar(HWND hWndParent, HINSTANCE hInst){

	HWND				hwndTB; 
	TBADDBITMAP			tbab; 
	TBBUTTON			TB_Button[6]; 
	INITCOMMONCONTROLSEX	icex;
	int				num_of_Buttons = 6,i;

	icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
	icex.dwICC  = ICC_BAR_CLASSES;
	InitCommonControlsEx(&amp;icex);

	tbab.hInst = hInst;
	tbab.nID = IDR_TOOLBAR1;

	hwndTB = CreateWindowEx(0, TOOLBARCLASSNAME, (LPSTR) NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hWndParent, (HMENU)NULL, NULL, NULL); 
	SendMessage(hwndTB, TB_SETBUTTONSIZE, 0, (LPARAM) MAKELONG (30, 30));
	SendMessage(hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);

	SendMessage(hwndTB, TB_ADDBITMAP, (WPARAM)num_of_Buttons, (LPARAM) &amp;tbab);
	SendMessage(hwndTB, TB_LOADIMAGES, IDR_TOOLBAR1, (LPARAM) hInst);
	ZeroMemory(&amp;TB_Button, sizeof(TBBUTTON)*num_of_Buttons);

	for(i=0; i &lt; num_of_Buttons; i++){
		TB_Button[i].fsState = TBSTATE_ENABLED; 
		TB_Button[i].fsStyle = TBSTYLE_BUTTON;
		TB_Button[i].iString = 0;
	}

	TB_Button[0].iBitmap = 0;
	TB_Button[0].idCommand = BUTTON_0; 
 	TB_Button[1].iBitmap = 1; 
	TB_Button[1].idCommand = BUTTON_1; 
	TB_Button[2].iBitmap = 2;
	TB_Button[2].idCommand = BUTTON_2; 
	TB_Button[3].iBitmap = 3; 
	TB_Button[3].idCommand = BUTTON_3; 
	TB_Button[4].iBitmap = 4; 
	TB_Button[4].idCommand = BUTTON_4; 
	TB_Button[5].iBitmap = 5; 
	TB_Button[5].idCommand = BUTTON_5; 

	SendMessage(hwndTB, TB_ADDBUTTONS, num_of_Buttons, (LPARAM) (LPTBBUTTON) &amp;TB_Button); 
	SendMessage(hwndTB, TB_AUTOSIZE, 0, 0); 					
	ShowWindow(hwndTB, SW_SHOW); 
	return hwndTB;
}
</code></pre>
<p>Weiß jemand Rat, was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/141743/button-größe-in-toolbar</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 10:26:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/141743.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Mar 2006 15:28:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Button Größe in Toolbar on Fri, 24 Mar 2006 15:28:38 GMT]]></title><description><![CDATA[<p>Ich versuche eine Tooolbar mit 6 Buttons der Größe 30x30 zu erstellen, das klappt auch soweit. Jedoch wird meine Bitmap Resource nicht richtig dargestellt. Das Bitmap wird in 16x16 große teile aufgeteilt und auf die Buttons gelegt, das Bitmap hat aber die Größe 30x180 = 6 Buttons. Hier ist mein Code:</p>
<pre><code>HWND ToolBar(HWND hWndParent, HINSTANCE hInst){

	HWND				hwndTB; 
	TBADDBITMAP			tbab; 
	TBBUTTON			TB_Button[6]; 
	INITCOMMONCONTROLSEX	icex;
	int				num_of_Buttons = 6,i;

	icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
	icex.dwICC  = ICC_BAR_CLASSES;
	InitCommonControlsEx(&amp;icex);

	tbab.hInst = hInst;
	tbab.nID = IDR_TOOLBAR1;

	hwndTB = CreateWindowEx(0, TOOLBARCLASSNAME, (LPSTR) NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hWndParent, (HMENU)NULL, NULL, NULL); 
	SendMessage(hwndTB, TB_SETBUTTONSIZE, 0, (LPARAM) MAKELONG (30, 30));
	SendMessage(hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);

	SendMessage(hwndTB, TB_ADDBITMAP, (WPARAM)num_of_Buttons, (LPARAM) &amp;tbab);
	SendMessage(hwndTB, TB_LOADIMAGES, IDR_TOOLBAR1, (LPARAM) hInst);
	ZeroMemory(&amp;TB_Button, sizeof(TBBUTTON)*num_of_Buttons);

	for(i=0; i &lt; num_of_Buttons; i++){
		TB_Button[i].fsState = TBSTATE_ENABLED; 
		TB_Button[i].fsStyle = TBSTYLE_BUTTON;
		TB_Button[i].iString = 0;
	}

	TB_Button[0].iBitmap = 0;
	TB_Button[0].idCommand = BUTTON_0; 
 	TB_Button[1].iBitmap = 1; 
	TB_Button[1].idCommand = BUTTON_1; 
	TB_Button[2].iBitmap = 2;
	TB_Button[2].idCommand = BUTTON_2; 
	TB_Button[3].iBitmap = 3; 
	TB_Button[3].idCommand = BUTTON_3; 
	TB_Button[4].iBitmap = 4; 
	TB_Button[4].idCommand = BUTTON_4; 
	TB_Button[5].iBitmap = 5; 
	TB_Button[5].idCommand = BUTTON_5; 

	SendMessage(hwndTB, TB_ADDBUTTONS, num_of_Buttons, (LPARAM) (LPTBBUTTON) &amp;TB_Button); 
	SendMessage(hwndTB, TB_AUTOSIZE, 0, 0); 					
	ShowWindow(hwndTB, SW_SHOW); 
	return hwndTB;
}
</code></pre>
<p>Weiß jemand Rat, was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023196</guid><dc:creator><![CDATA[Einsteiger]]></dc:creator><pubDate>Fri, 24 Mar 2006 15:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to Button Größe in Toolbar on Fri, 24 Mar 2006 15:48:07 GMT]]></title><description><![CDATA[<p>msdn schrieb:</p>
<blockquote>
<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>
<p>schon probiert?<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/toolbar/messages/tb_setbitmapsize.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/toolbar/messages/tb_setbitmapsize.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023217</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Fri, 24 Mar 2006 15:48:07 GMT</pubDate></item><item><title><![CDATA[Reply to Button Größe in Toolbar on Fri, 24 Mar 2006 16:07:35 GMT]]></title><description><![CDATA[<p>Super, hat geklappt, 1000 Dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023231</guid><dc:creator><![CDATA[Einsteiger]]></dc:creator><pubDate>Fri, 24 Mar 2006 16:07:35 GMT</pubDate></item></channel></rss>