<?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[Unkompliziertester Weg, einen Button mittels Bitmap darzustellen]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Kann mir jemand sagen, wie ich es so schnell und unkompliziert wie möglich bewerkstelligen kann, dass mein Button einzig und allein durch eine Bitmap dargestellt wird, sprich ohne die vom Systemdesign abhängig zu sein?</p>
<p>Vielen Dank schon mal im Voraus,<br />
veryxRV</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/194426/unkompliziertester-weg-einen-button-mittels-bitmap-darzustellen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 17:43:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/194426.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Oct 2007 17:12:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:12:20 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>Kann mir jemand sagen, wie ich es so schnell und unkompliziert wie möglich bewerkstelligen kann, dass mein Button einzig und allein durch eine Bitmap dargestellt wird, sprich ohne die vom Systemdesign abhängig zu sein?</p>
<p>Vielen Dank schon mal im Voraus,<br />
veryxRV</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379304</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:12:20 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:22:43 GMT]]></title><description><![CDATA[<pre><code>-------------------------------------------------------------------------------------------------------
+-------------------+
| Bitmap einbinden: |
+-------------------+
_____________________
Definierte Variablen:
	static HANDLE hBitmap;
	static HWND hButton;
_____________________
Einbinden der Bitmap:
    case WM_CREATE:
        hBitmap = LoadImage (GetModuleHandle (NULL), &quot;bitmap1.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE);

  	  hButton = CreateWindow (&quot;Button&quot;, &quot;&quot;, WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_BITMAP, 20, 20, 50, 30, hWnd1, 0, GetModuleHandle (NULL),  0);
    	SendMessage (hButton, BM_SETIMAGE, (WPARAM) IMAGE_BITMAP, (LPARAM)(HANDLE) hBitmap);

		DeleteObject (hBitmap);
    return 0;

-------------------------------------------------------------------------------------------------------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1379311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379311</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:22:43 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:17:49 GMT]]></title><description><![CDATA[<p>Danke, aber das Problem bei der Sache ist nur, dass der dösige 3D Rahmen weiterhin dargestellt wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379314</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:17:49 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:20:22 GMT]]></title><description><![CDATA[<p>Dann BS_FLAT noch hinzufügen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379315</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:20:22 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:22:20 GMT]]></title><description><![CDATA[<p>Das erzeugt leider auch einen dicken schwarzen Ramen um den Button.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379316</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:22:20 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:31:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">LPDRAWITEMSTRUCT lpdis;
static HDC hdcMem;
.
.
.
case WM_CREATE:
    hButton = CreateWindow (&quot;Button&quot;, &quot;&quot;, WS_VISIBLE | WS_CHILD | BS_OWNERDRAW, 20, 20, 50, 30, hWnd1, (HMENU) ID_BUTTON, GetModuleHandle (NULL),  0);
return 0;

case WM_DRAWITEM:
    lpdis = (LPDRAWITEMSTRUCT) lParam;
    hdcMem = CreateCompatibleDC (lpdis-&gt;hDC);

	if (lpdis-&gt;CtlID == ID_BUTTON)
        SelectObject (hdcMem, LoadImage (GetModuleHandle (NULL), &quot;bitmap1.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE));

    StretchBlt (lpdis-&gt;hDC, lpdis-&gt;rcItem.left, lpdis-&gt;rcItem.top, lpdis-&gt;rcItem.right - lpdis-&gt;rcItem.left, lpdis-&gt;rcItem.bottom - lpdis-&gt;rcItem.top, hdcMem, 0, 0, 20, 20, SRCCOPY);
    DeleteDC (hdcMem);
return 0;
.
.
.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1379317</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379317</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:31:07 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:28:13 GMT]]></title><description><![CDATA[<p>Alles klar <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>EDIT: Was ich noch vergessen hatte zu erwähnen, ist, dass ich es möglichst übersichtlich auf alle Buttons in meinem Prgramm anwenden können sollte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379318</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:28:13 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:41:41 GMT]]></title><description><![CDATA[<p>Um mehrere Button zu &quot;verwalten, füge einfach noch ein paar hiervon hinzu:</p>
<pre><code class="language-cpp">if (lpdis-&gt;CtlID == ID_BUTTON)
        SelectObject (hdcMem, LoadImage (GetModuleHandle (NULL), &quot;bitmap1.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE));
</code></pre>
<p>einfach ID_BUTTON und &quot;bitmap1.bmp&quot; ersetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379331</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:41:41 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:44:51 GMT]]></title><description><![CDATA[<p>Die Buttons sollten dafür aber ownderdrawn sein oder?</p>
<p>EDIT: Steht ja da. Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379335</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:44:51 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 17:50:04 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">SelectObject(hdcMem, LoadImage (hInst, (LPCSTR) IDB_BTT_ADD_N, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE));
</code></pre>
<p>Hier bekomme ich leider eine Zugriffsverletzung....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379340</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 17:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 18:18:47 GMT]]></title><description><![CDATA[<p>Vergiß auch ned das Handle, was LoadImage zurückgibt, mit DeleteObject wieder freizugeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379358</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Sat, 06 Oct 2007 18:18:47 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 18:36:48 GMT]]></title><description><![CDATA[<p>Hallo tenchou,</p>
<p>entschuldige diese vielleicht etwas unangenehme Frage, aber wie alt bist du? Manche Leute in diesem Forum stellen die Vermutung an, dass sich dein Alter im Bereich 15-7 Jahre bewegt. Ist das wahr?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379372</guid><dc:creator><![CDATA[CodeOriginator]]></dc:creator><pubDate>Sat, 06 Oct 2007 18:36:48 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 19:13:31 GMT]]></title><description><![CDATA[<p>CodeOriginator schrieb:</p>
<blockquote>
<p>Hallo tenchou,</p>
<p>entschuldige diese vielleicht etwas unangenehme Frage, aber wie alt bist du? Manche Leute in diesem Forum stellen die Vermutung an, dass sich dein Alter im Bereich 15-7 Jahre bewegt. Ist das wahr?</p>
</blockquote>
<p>Was hat das denn mit seiner Frage oder mit WinAPI zu tun??! Aber ich kann dich beruhigen, mein Alter bewegt sich nicht im Bereich 15-7 Jahre!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379385</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Sat, 06 Oct 2007 19:13:31 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 19:14:51 GMT]]></title><description><![CDATA[<p>Verstehe gerade auch nicht was das soll, aber okay. Der Code läuft jedenfalls gut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379386</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 19:14:51 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 22:34:37 GMT]]></title><description><![CDATA[<p>wenn du zum Beispiel das hier machst (in WM_DRAWITEM):</p>
<pre><code class="language-cpp">if (lpdis-&gt;itemState &amp; ODS_SELECTED)
{
    if (lpdis-&gt;CtlID == ID_BUTTON)
        SelectObject (hdcMem, LoadImage (GetModuleHandle (NULL), &quot;bitmap_sel.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE));
}
else
{
    if (lpdis-&gt;CtlID == ID_BUTTON)
        SelectObject (hdcMem, LoadImage (GetModuleHandle (NULL), &quot;bitmap.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE));
}
</code></pre>
<p>kannst du auch noch verschiedene Bilder für einen Button einstellen, wenn dieser gerade gedrückt wird. Also 2 Bilder: 1 wenn der Buton gedrückt wurde und 1 wenn irgend etwas anderes mit dem Button ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379388</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379388</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 22:34:37 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 19:27:09 GMT]]></title><description><![CDATA[<p>Danke für den Tip, das wäre der nächste Schritt gewesen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1379392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379392</guid><dc:creator><![CDATA[veryxRV]]></dc:creator><pubDate>Sat, 06 Oct 2007 19:27:09 GMT</pubDate></item><item><title><![CDATA[Reply to Unkompliziertester Weg, einen Button mittels Bitmap darzustellen on Sat, 06 Oct 2007 19:31:12 GMT]]></title><description><![CDATA[<p>Dachte ich mir schon und deshalb habe ich das einfach mal vorausschauend gepostet <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/1379394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1379394</guid><dc:creator><![CDATA[Fake oder Echt]]></dc:creator><pubDate>Sat, 06 Oct 2007 19:31:12 GMT</pubDate></item></channel></rss>