<?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össe ändern]]></title><description><![CDATA[<p>Hallo zusammen,<br />
ich habe nach der Anleitung <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-111101.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-111101.html</a> eine Toolbar gebastelt, welche auch wunderbar läuft.</p>
<p>Gibt es eine Möglichkeit, die Grösse der Buttons zu verändern?</p>
<p>Grüsse,<br />
Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169845/button-grösse-ändern</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 16:40:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169845.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Jan 2007 15:22:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Button Grösse ändern on Tue, 09 Jan 2007 15:22:25 GMT]]></title><description><![CDATA[<p>Hallo zusammen,<br />
ich habe nach der Anleitung <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-111101.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-111101.html</a> eine Toolbar gebastelt, welche auch wunderbar läuft.</p>
<p>Gibt es eine Möglichkeit, die Grösse der Buttons zu verändern?</p>
<p>Grüsse,<br />
Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1206382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1206382</guid><dc:creator><![CDATA[Thomas_der_fragende]]></dc:creator><pubDate>Tue, 09 Jan 2007 15:22:25 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Tue, 09 Jan 2007 17:15:42 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/messagesandmessagequeues/messagesandmessagequeuesreference/messagesandmessagequeuesfunctions/sendmessage.asp" rel="nofollow">SendMessage</a> mit der Nachricht <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/toolbar/messages/tb_addbuttons.asp" rel="nofollow">TB_SETBUTTONINFO</a>.<br />
Du setzt den Member <em>dwMask</em> der Struktur <a href="http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/toolbar/structures/tbbuttoninfo.asp" rel="nofollow">TBBUTTONINFO</a> auf <em>TBIF_SIZE</em>, iniitialisierst <em>cbSize</em> mit der Größe der Struktur (<em>sizeof</em>-Operator) und gibst im Member <em>cx</em> Deine neue Größe (Breite) an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1206449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1206449</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 09 Jan 2007 17:15:42 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Tue, 09 Jan 2007 18:31:18 GMT]]></title><description><![CDATA[<p>Meinst du etwa so?</p>
<pre><code class="language-cpp">TBBUTTONINFO tbbi;
ZeroMemory(&amp;tbbi, sizeof(tbbutton));

tbbi.cbSize = sizeof(tbbutton);
tbbi.dwMask = TBIF_SIZE;
tbbi.cx = 100;
SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, TBIF_SIZE, (LPARAM)&amp;tbbi);
</code></pre>
<p>Dies hat keine Auswirkung.</p>
<p>Thomas</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1206497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1206497</guid><dc:creator><![CDATA[Thomas_der fragende]]></dc:creator><pubDate>Tue, 09 Jan 2007 18:31:18 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Tue, 09 Jan 2007 19:21:46 GMT]]></title><description><![CDATA[<p><em>wParam</em> muss die ID des Buttons sein!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1206531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1206531</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 09 Jan 2007 19:21:46 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Wed, 10 Jan 2007 09:43:42 GMT]]></title><description><![CDATA[<p>CodeFinder, ich stehe wohl ein wenig auf dem Schlauch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /><br />
Welches soll die ButtonID sein? bitid?<br />
TB_SETBUTTONINFO muss doch auch nach TB_ADDBUTTONS kommen?</p>
<p>Für ein wenig Licht bin ich dankbar.</p>
<p>Thomas</p>
<pre><code class="language-cpp">void tb_add_button(HWND hwnd_toolbar, int command, char* bitmap_filename, int style = TBSTYLE_BUTTON)
{ 
		//Bitmap einladen
		HBITMAP h_bitmap;
        h_bitmap = (HBITMAP)LoadImage(  NULL,
                                        bitmap_filename,      // name or identifier of image
                                        IMAGE_BITMAP,          // type of image
                                        16,                      // desired width
                                        16,                      // desired height
                                        LR_LOADFROMFILE          // load flags
										);

        //fill ADDBITMAP-Structur and overgive Bitmap-Handle
		TBADDBITMAP bitid; 
		bitid.hInst = NULL;
        bitid.nID = (UINT)h_bitmap;

        TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
        tbbutton.iBitmap = SendMessage(hwnd_toolbar, TB_ADDBITMAP, 1, (long)&amp;bitid);  
        tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
        tbbutton.fsState = TBSTATE_ENABLED;
        tbbutton.fsStyle = TBSTYLE_BUTTON;
        tbbutton.dwData = 0;
        tbbutton.iString = NULL;

		TBBUTTONINFO tbbi;
		ZeroMemory(&amp;tbbi, sizeof(tbbutton));

		tbbi.cbSize = sizeof(tbbutton);
		tbbi.dwMask = TBIF_SIZE;
		tbbi.cx = 100;

        //At last, add the button to the Toolbar
        SendMessage(hwnd_toolbar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM) (LPTBBUTTON) &amp;tbbutton); 

		SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, (WPARAM)???? , (LPARAM)&amp;tbbi); 

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1206915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1206915</guid><dc:creator><![CDATA[Thomas_der_fragende]]></dc:creator><pubDate>Wed, 10 Jan 2007 09:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Wed, 10 Jan 2007 18:10:02 GMT]]></title><description><![CDATA[<blockquote>
<p>Welches soll die ButtonID sein? bitid?</p>
</blockquote>
<p>Jeder Button muss eine eigene Identität haben, damit er erkannt wird, bzw. es ist sowas wie sein eigener Name. Es sieht so aus, als würdest du die API - Basics leider nicht beherrschen. Lies dir doch einfach mal ein gutes Tutorial dazu durch, nimm z.B <a href="http://winprog.org/tutorial/" rel="nofollow">http://winprog.org/tutorial/</a> da wird auch das mit den Buttons erklärt. Ein nicht so ausführliches, aber trotzdem gutes Tut ist auch noch dieses hier: <a href="http://www.win-api.de/tutorials.php" rel="nofollow">http://www.win-api.de/tutorials.php</a></p>
<p>Viel Spaß beim Durchlesen und Lernen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
<p>Mikey.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207336</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Wed, 10 Jan 2007 18:10:02 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Wed, 10 Jan 2007 21:58:16 GMT]]></title><description><![CDATA[<p>Die ID entspricht hier dem Parameter <em>command</em> (<em>int</em>) den Du 'Deiner' Funktion <em>tb_add_button</em> übergeben hast.</p>
<p>Du solltest Dir allerdings trotzdem mikey's Rat zu Herzen nehmen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207548</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 10 Jan 2007 21:58:16 GMT</pubDate></item><item><title><![CDATA[Reply to Button Grösse ändern on Thu, 11 Jan 2007 14:11:49 GMT]]></title><description><![CDATA[<p>Danke Euch beiden für die Hilfe.<br />
So funktioniert es.</p>
<p>Gruss,<br />
Thomas</p>
<pre><code class="language-cpp">void tb_add_button(HWND hwnd_toolbar, int command, int bitmap_name, char* text, int style = TBSTYLE_BUTTON)
{ 
	TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = bitmap_name;
    tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = TBSTATE_ENABLED;
    tbbutton.fsStyle = style;
    tbbutton.dwData = 0;
    tbbutton.iString = NULL;
    SendMessage(hwnd_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton); 
	SendMessage(hwnd_toolbar, TB_ADDSTRING, (WPARAM) 1, (LPARAM) &quot;0&quot;);

	TBBUTTONINFO tbbi;
	ZeroMemory(&amp;tbbi, sizeof(tbbi));
	tbbi.cbSize = sizeof(tbbi);
	tbbi.dwMask = TBIF_SIZE;
    tbbi.cx = 200; 
	SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, (WPARAM)command, (LPARAM)&amp;tbbi); 

	TBBUTTONINFO tbbi1;
	ZeroMemory(&amp;tbbi1, sizeof(tbbi1));
	tbbi1.cbSize = sizeof(tbbi1);
	tbbi1.dwMask = TBIF_TEXT;
	tbbi1.pszText = text;
	SendMessage(hwnd_toolbar, TB_SETBUTTONINFO, (WPARAM)command, (LPARAM)&amp;tbbi1); 	
}

int WINAPI WinMain(...)
{
	tb_add_button(hwnd_toolbar,2, 6, &quot;Create a new dataset&quot;,0);
	tb_add_button(hwnd_toolbar,1, 8, &quot;Copy to clipboard&quot;, 0);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1207961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207961</guid><dc:creator><![CDATA[Thomas_der_fragende]]></dc:creator><pubDate>Thu, 11 Jan 2007 14:11:49 GMT</pubDate></item></channel></rss>