<?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[Icon zur Laufzeit ändern]]></title><description><![CDATA[<p>Hallo,</p>
<p>angenommen ich will das Standard-Icon (IDR_MAINFRAME) zur Laufzeit verändern (z.B. einen schwarzen Strich draufmalen) und es dann in dieser abgeänderten Form wieder anzeigen.<br />
Weiß jemand wie das geht?</p>
<p>Gruß,<br />
Michel</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/48102/icon-zur-laufzeit-ändern</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 13:39:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/48102.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Sep 2003 09:40:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Fri, 05 Sep 2003 09:40:45 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>angenommen ich will das Standard-Icon (IDR_MAINFRAME) zur Laufzeit verändern (z.B. einen schwarzen Strich draufmalen) und es dann in dieser abgeänderten Form wieder anzeigen.<br />
Weiß jemand wie das geht?</p>
<p>Gruß,<br />
Michel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/347730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/347730</guid><dc:creator><![CDATA[Der Michel]]></dc:creator><pubDate>Fri, 05 Sep 2003 09:40:45 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Fri, 05 Sep 2003 09:58:31 GMT]]></title><description><![CDATA[<p>CWnd::SetIcon oder explizit kann man die WM_SETICON Nachricht schicken</p>
]]></description><link>https://www.c-plusplus.net/forum/post/347738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/347738</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 05 Sep 2003 09:58:31 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Fri, 05 Sep 2003 10:11:22 GMT]]></title><description><![CDATA[<p>Ok,<br />
das ist gut, aber wie kann ich überhaupt in das Icon etwas malen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/347747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/347747</guid><dc:creator><![CDATA[Der Michel]]></dc:creator><pubDate>Fri, 05 Sep 2003 10:11:22 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Fri, 05 Sep 2003 18:55:13 GMT]]></title><description><![CDATA[<p>so sollte es gehen:</p>
<pre><code class="language-cpp">CDC* pDC = GetDC(this), MemDC;
CBitmap Bitmap;
CImageList ImageList;

//Imagelist 16x16 Pixel mit einer Maske und 32-Bit Farbtiefe erstellen
ImageList.Create(16,16,ILC_COLOR32|ILC_MASK,0,1);

MemDC.CreateCompatibleDC(pDC);
Bitmap.CreateCompatibleBitmap(pDC,16,16);
MemDC.SelectObject(&amp;Bitmap);

MemDC.FillRect(0,0,16,16,RGB(255,0,0)); //Irgendwas drauf malen

ImageList.Add(&amp;Bitmap,RGB(0,0,0));
//Icon setzen
SetIcon(ImageList.ExtractIcon(0),FALSE);

//Device Contexts bzw. Gdi Objekte wieder freigeben/löschen
ReleaseDC(pDC), MemDC.DeleteDC(), Bitmap.DeleteObject();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/348097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/348097</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Fri, 05 Sep 2003 18:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Sat, 06 Sep 2003 09:56:18 GMT]]></title><description><![CDATA[<p>Hmm... so richtig haut das nicht hin, was ich auch einstell, irgendwie wird das Icon immer schwarz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/348307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/348307</guid><dc:creator><![CDATA[Der Michel]]></dc:creator><pubDate>Sat, 06 Sep 2003 09:56:18 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Sat, 06 Sep 2003 12:29:12 GMT]]></title><description><![CDATA[<p>CImageList Objekt muss Member deiner CDialog abgeleiteten Klasse sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/348452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/348452</guid><dc:creator><![CDATA[Shlo]]></dc:creator><pubDate>Sat, 06 Sep 2003 12:29:12 GMT</pubDate></item><item><title><![CDATA[Reply to Icon zur Laufzeit ändern on Sat, 06 Sep 2003 13:42:36 GMT]]></title><description><![CDATA[<p>Ich habs das CImageList Objekt als private eingefügt, aber noch immer weigert er sich standhaft. Die betreffende Stelle sieht nun so aus:</p>
<pre><code class="language-cpp">CDC* pDC = GetDC(), MemDC; 
CBitmap Bitmap; 

//Imagelist 16x16 Pixel mit einer Maske und 32-Bit Farbtiefe erstellen 
m_ImgList.Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); 

MemDC.CreateCompatibleDC(pDC); 
Bitmap.CreateCompatibleBitmap(pDC, 16, 16); 
MemDC.SelectObject(&amp;Bitmap); 

CBrush bru(RGB(255, 0, 0));
CRect rect(0, 0, 8, 8);
MemDC.FillRect(rect, &amp;bru); //Irgendwas drauf malen 

m_ImgList.Add(&amp;Bitmap, RGB(0,0,0)); 
//Icon setzen 
SetIcon(m_ImgList.ExtractIcon(0),FALSE); 

//Device Contexts bzw. Gdi Objekte wieder freigeben/löschen 
ReleaseDC(pDC);
MemDC.DeleteDC();
Bitmap.DeleteObject();
</code></pre>
<p>aber das Icon ist immer noch schwarz. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/348493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/348493</guid><dc:creator><![CDATA[Der Michel]]></dc:creator><pubDate>Sat, 06 Sep 2003 13:42:36 GMT</pubDate></item></channel></rss>