<?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[static feld färben]]></title><description><![CDATA[<p>Also ich habe einen Dialog und möchte dort gerne einem static control eine andere Farbe geben. Ich habe dazu folgenden code genomme:</p>
<pre><code>case WM_CTLCOLORSTATIC:

		if(lParam==IDC_STATIC)
		{
		SetTextColor((HDC)wwpp, RGB(0, 0, 255));
		return (BOOL) hBrush;
		}
</code></pre>
<p>aber dieser funktioniert nur wenn ich die if weg mache... aber dann werden alle felder eingefärbt. Wie sollte der code den aussehn um nur bei einem feld die farbe zu ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/76123/static-feld-färben</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 08:36:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76123.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Jun 2004 05:10:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 05:10:47 GMT]]></title><description><![CDATA[<p>Also ich habe einen Dialog und möchte dort gerne einem static control eine andere Farbe geben. Ich habe dazu folgenden code genomme:</p>
<pre><code>case WM_CTLCOLORSTATIC:

		if(lParam==IDC_STATIC)
		{
		SetTextColor((HDC)wwpp, RGB(0, 0, 255));
		return (BOOL) hBrush;
		}
</code></pre>
<p>aber dieser funktioniert nur wenn ich die if weg mache... aber dann werden alle felder eingefärbt. Wie sollte der code den aussehn um nur bei einem feld die farbe zu ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/535646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535646</guid><dc:creator><![CDATA[Eggi]]></dc:creator><pubDate>Tue, 08 Jun 2004 05:10:47 GMT</pubDate></item><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 06:11:59 GMT]]></title><description><![CDATA[<p>Indem Du deinem Feld eine eindeutige ID gibst und sie dementsprechend in der if-Abfrage einbaust...</p>
<pre><code class="language-cpp">case WM_CTLCOLORSTATIC:
    if(lParam==IDC_MEINFARBIGESSTATICFELD)
    {
        SetTextColor((HDC)wwpp, RGB(0, 0, 255));
        return (BOOL) hBrush;
    }
    return FALSE;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/535670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535670</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Tue, 08 Jun 2004 06:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 06:12:51 GMT]]></title><description><![CDATA[<ol>
<li>lParam ist das HWND nich der DlgCtrlID des statics</li>
<li>IDC_STATIC sollte nur für controls verwendet werden, die nicht &quot;identifiziert&quot; werden müssen</li>
</ol>
<p>[cpp]<br />
if( GetDlgCtrlID( (HWND)lParam)==IDC_ST_PAINT_ME)<br />
{<br />
SetTextColor((HDC)wwpp, RGB(0, 0, 255));<br />
return (<strong>LRESULT</strong>) hBrush;<br />
}<br />
[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/535671</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535671</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Tue, 08 Jun 2004 06:12:51 GMT</pubDate></item><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 08:45:10 GMT]]></title><description><![CDATA[<p>peterchen schrieb:</p>
<blockquote>
<p>[cpp]<br />
return (<strong>LRESULT</strong>) hBrush;<br />
[/cpp]</p>
</blockquote>
<p><a href="http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolmessages/wm_ctlcolorstatic.asp" rel="nofollow">WM_CTLCOLORSTATIC</a></p>
<p>MSDN schrieb:</p>
<blockquote>
<p>If a dialog box procedure handles this message, it should <strong>cast the desired return value to a BOOL</strong> and return the value directly. If the dialog box procedure returns FALSE, then default message handling is performed.</p>
</blockquote>
<p>Bei Dialogen soll man auf BOOL casten (da er es in seinem Code selber tut, gehe ich mal davon aus, das er es in einer DialogProzedur macht. Bei &quot;normalen&quot; Fensterprozeduren hast Du natürlich Recht)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/535725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535725</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Tue, 08 Jun 2004 08:45:10 GMT</pubDate></item><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 08:51:53 GMT]]></title><description><![CDATA[<p>ups - da unten hab ich nicht mehr gelesen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/535781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535781</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Tue, 08 Jun 2004 08:51:53 GMT</pubDate></item><item><title><![CDATA[Reply to static feld färben on Tue, 08 Jun 2004 11:23:49 GMT]]></title><description><![CDATA[<p>thx fuer die Antworten, hat super geklappt :).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/535936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/535936</guid><dc:creator><![CDATA[Eggi]]></dc:creator><pubDate>Tue, 08 Jun 2004 11:23:49 GMT</pubDate></item></channel></rss>