<?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[toolbar mit bitmaps]]></title><description><![CDATA[<p>Hi.</p>
<p>in anlehnung an &quot;code_pilot&quot; (<a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-595048.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-p-is-595048.html</a>) versuche ich ebenfalls meine eigenen bitmaps in die toolbar zu laden. es ist kein problem, wenn es ein button ist. ich bekomme es aber leider nicht hin, für den zweiten button ein anderes bild zu laden.</p>
<p>mein code sieht wie folgt aus. danke für hilfe.<br />
STICK.</p>
<p>TBADDBITMAP tbab;<br />
TBBUTTON tbb [2];</p>
<p>hTool = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,hWnd, (HMENU)IDC_MAIN_TOOL, GetModuleHandle(NULL), NULL);</p>
<p>if(hTool == NULL)<br />
MessageBox(hWnd, &quot;Could not create tool bar.&quot;, &quot;Error&quot;, MB_OK | MB_ICONERROR);</p>
<p>SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);</p>
<p>tbab.hInst = HINST_COMMCTRL;<br />
tbab.nID = IDB_STD_SMALL_COLOR;</p>
<p>ZeroMemory(tbb, sizeof(tbb));<br />
tbab.hInst = GetModuleHandle(NULL);<br />
tbab.nID = (IDB_BITMAP1,IDB_BITMAP2);<br />
tbb[0].iBitmap = SendMessage(hTool,TB_ADDBITMAP,0,(LPARAM)&amp;tbab);<br />
tbb[0].fsState = TBSTATE_ENABLED;<br />
tbb[0].fsStyle = TBSTYLE_BUTTON;<br />
tbb[0].idCommand = IDM_ZOOMIN;</p>
<p>tbb[1].iBitmap = SendMessage(hTool,TB_ADDBITMAP,0,(LPARAM)&amp;tbab);<br />
tbb[1].fsState = TBSTATE_ENABLED;<br />
tbb[1].fsStyle = TBSTYLE_BUTTON;<br />
tbb[1].idCommand = IDM_ZOOMOUT;<br />
SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&amp;tbab);</p>
<p>SendMessage (hTool, TB_ADDBUTTONS, (WPARAM)sizeof(tbb)/sizeof(tbb[0]), (LPARAM)(TBBUTTON*)&amp;tbb);</p>
<p>SendMessage (hTool, TB_AUTOSIZE, 0, 0);<br />
ShowWindow (hTool, SW_SHOW);<br />
UpdateWindow (hTool);</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/132647/toolbar-mit-bitmaps</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 19:39:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/132647.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 12 Jan 2006 10:54:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to toolbar mit bitmaps on Thu, 12 Jan 2006 10:54:05 GMT]]></title><description><![CDATA[<p>Hi.</p>
<p>in anlehnung an &quot;code_pilot&quot; (<a href="http://www.c-plusplus.net/forum/viewtopic-var-p-is-595048.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-p-is-595048.html</a>) versuche ich ebenfalls meine eigenen bitmaps in die toolbar zu laden. es ist kein problem, wenn es ein button ist. ich bekomme es aber leider nicht hin, für den zweiten button ein anderes bild zu laden.</p>
<p>mein code sieht wie folgt aus. danke für hilfe.<br />
STICK.</p>
<p>TBADDBITMAP tbab;<br />
TBBUTTON tbb [2];</p>
<p>hTool = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,hWnd, (HMENU)IDC_MAIN_TOOL, GetModuleHandle(NULL), NULL);</p>
<p>if(hTool == NULL)<br />
MessageBox(hWnd, &quot;Could not create tool bar.&quot;, &quot;Error&quot;, MB_OK | MB_ICONERROR);</p>
<p>SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);</p>
<p>tbab.hInst = HINST_COMMCTRL;<br />
tbab.nID = IDB_STD_SMALL_COLOR;</p>
<p>ZeroMemory(tbb, sizeof(tbb));<br />
tbab.hInst = GetModuleHandle(NULL);<br />
tbab.nID = (IDB_BITMAP1,IDB_BITMAP2);<br />
tbb[0].iBitmap = SendMessage(hTool,TB_ADDBITMAP,0,(LPARAM)&amp;tbab);<br />
tbb[0].fsState = TBSTATE_ENABLED;<br />
tbb[0].fsStyle = TBSTYLE_BUTTON;<br />
tbb[0].idCommand = IDM_ZOOMIN;</p>
<p>tbb[1].iBitmap = SendMessage(hTool,TB_ADDBITMAP,0,(LPARAM)&amp;tbab);<br />
tbb[1].fsState = TBSTATE_ENABLED;<br />
tbb[1].fsStyle = TBSTYLE_BUTTON;<br />
tbb[1].idCommand = IDM_ZOOMOUT;<br />
SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&amp;tbab);</p>
<p>SendMessage (hTool, TB_ADDBUTTONS, (WPARAM)sizeof(tbb)/sizeof(tbb[0]), (LPARAM)(TBBUTTON*)&amp;tbb);</p>
<p>SendMessage (hTool, TB_AUTOSIZE, 0, 0);<br />
ShowWindow (hTool, SW_SHOW);<br />
UpdateWindow (hTool);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/964379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/964379</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Thu, 12 Jan 2006 10:54:05 GMT</pubDate></item><item><title><![CDATA[Reply to toolbar mit bitmaps on Fri, 13 Jan 2006 12:41:45 GMT]]></title><description><![CDATA[<p>vielleicht gibt es hier anregungen:<br />
<a href="http://hem.passagen.se/sm3gsj/" rel="nofollow">hem.passagen.se/sm3gsj/</a> programmering/gcmprogramming03.htm</p>
<p>meist werden die selbst gezeichneten bitmaps nicht einzeln<br />
sondern als z.b. 16 mal (16 mal anzahl gezeichneter buttons)<br />
bildpunkte gezeichnet.</p>
<p>mfg f.-th.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/965435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/965435</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Fri, 13 Jan 2006 12:41:45 GMT</pubDate></item><item><title><![CDATA[Reply to toolbar mit bitmaps on Sat, 14 Jan 2006 15:14:31 GMT]]></title><description><![CDATA[<p>servus.</p>
<p>danke für die antwort, habe aber das problem bereits durch geschicktes herumprobieren selber gelöst. mein code sieht jetzt so aus:</p>
<p>// erster button<br />
tbab.hInst = GetModuleHandle(NULL);<br />
tbab.nID = IDB_BITMAP1;<br />
tbb[2].fsState = TBSTATE_ENABLED;<br />
tbb[2].fsStyle = TBSTYLE_BUTTON;<br />
tbb[2].idCommand = IDM_ZOOMIN;<br />
tbb[2].iBitmap = SendMessage(hTool,TB_ADDBITMAP,1,(LPARAM)&amp;tbab);</p>
<p>//zweiter button<br />
tbab.hInst = GetModuleHandle(NULL);<br />
tbab.nID = IDB_BITMAP2;<br />
tbb[3].iBitmap = 0;<br />
tbb[3].fsState = TBSTATE_ENABLED;<br />
tbb[3].fsStyle = TBSTYLE_BUTTON;<br />
tbb[3].idCommand = IDM_ZOOMOUT;<br />
tbb[3].iBitmap = SendMessage(hTool,TB_ADDBITMAP,2,(LPARAM)&amp;tbab);</p>
<p>grüsse. STICK</p>
]]></description><link>https://www.c-plusplus.net/forum/post/966428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/966428</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Sat, 14 Jan 2006 15:14:31 GMT</pubDate></item></channel></rss>