<?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[Hab Problem bei WM_CTLCOLORSTATIC]]></title><description><![CDATA[<pre><code class="language-cpp">case WM_CTLCOLORSTATIC:
{
   SetBkMode((HDC)wParam,OPAQUE); 
   SetBkColor  ((HDC)  wParam, RGB ( 0 ,  0, 0));
   SetTextColor((HDC)  wParam, RGB (  255, 255, 255));
}
return (LONG)g_hbrBackground;
</code></pre>
<p>hab mit diesem Code Bsp meine statics gefaerbt, jetzt zu meinem problem wie Aendere ich waerend der laufzeit bsp. durch Button Click die farbe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169615/hab-problem-bei-wm_ctlcolorstatic</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 19:44:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169615.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 Jan 2007 00:17:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hab Problem bei WM_CTLCOLORSTATIC on Sun, 07 Jan 2007 00:17:50 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">case WM_CTLCOLORSTATIC:
{
   SetBkMode((HDC)wParam,OPAQUE); 
   SetBkColor  ((HDC)  wParam, RGB ( 0 ,  0, 0));
   SetTextColor((HDC)  wParam, RGB (  255, 255, 255));
}
return (LONG)g_hbrBackground;
</code></pre>
<p>hab mit diesem Code Bsp meine statics gefaerbt, jetzt zu meinem problem wie Aendere ich waerend der laufzeit bsp. durch Button Click die farbe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1204745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204745</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 07 Jan 2007 00:17:50 GMT</pubDate></item><item><title><![CDATA[Reply to Hab Problem bei WM_CTLCOLORSTATIC on Sun, 07 Jan 2007 01:22:24 GMT]]></title><description><![CDATA[<p>Setze für den Farbwerte ne statische Variable (in der WndProc) und änder die Werte (der statischen Variablen) unter dem entsprechenden <em>WM_COMMAND</em>-Handler. Danach Rufst Du</p>
<pre><code class="language-cpp">InvalidateRect(hWndStatic, NULL, TRUE);
</code></pre>
<p>auf, um Static-Controls zu aktualisieren.</p>
<p>Also sieht Dein Handler dann in etwa so aus:</p>
<pre><code class="language-cpp">static UINT uiStaticBkColor, uiStaticTextColor;
switch(uiMessage)
{

// ...
case WM_CTLCOLORSTATIC:
{
   SetBkMode((HDC)wParam,OPAQUE); 
   SetBkColor  ((HDC)  wParam, uiStaticBkColor);
   SetTextColor((HDC)  wParam, uiStaticTextColor);
}
return (LONG)g_hbrBackground;
</code></pre>
<p>Vergiss nicht, bei <em>WM_CREATE</em> einen Anfangswert zu setzen <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/1204763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204763</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 07 Jan 2007 01:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to Hab Problem bei WM_CTLCOLORSTATIC on Sun, 07 Jan 2007 01:55:34 GMT]]></title><description><![CDATA[<p>Funktioniert super sogar auf anhiep THX <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
Haet net gedacht das das so eifach is haet man drauf kommen koennen <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/1204767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1204767</guid><dc:creator><![CDATA[Ascharan]]></dc:creator><pubDate>Sun, 07 Jan 2007 01:55:34 GMT</pubDate></item></channel></rss>