<?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[Statics, die 1.000.000ste]]></title><description><![CDATA[<p>Und wieder gibt es ein Thema über Statics!<br />
Wie kann ich die Schrift auf einem Static vertikal zentrieren? Und irgendwie krieg ich es nicht hin, ein Static die Hintergrundfarbe zu geben, die ich brauche. Es klappt zwar ein Staticfeld über SetBkMode Transparent zu machen, aber es klappt nicht es mit SetBkColor beliebig einzufärben. Wie geht das?</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/141830/statics-die-1-000-000ste</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 14:14:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/141830.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Mar 2006 13:27:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:29:11 GMT]]></title><description><![CDATA[<p>Und wieder gibt es ein Thema über Statics!<br />
Wie kann ich die Schrift auf einem Static vertikal zentrieren? Und irgendwie krieg ich es nicht hin, ein Static die Hintergrundfarbe zu geben, die ich brauche. Es klappt zwar ein Staticfeld über SetBkMode Transparent zu machen, aber es klappt nicht es mit SetBkColor beliebig einzufärben. Wie geht das?</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023693</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:29:11 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:30:33 GMT]]></title><description><![CDATA[<p>Was die Hintergrundfarbe betrifft, so sollte Dir <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/staticcontrols/staticcontrolreference/staticcontrolmessages/wm_ctlcolorstatic.asp" rel="nofollow">WM_CTLCOLORSTATIC</a> weiterhelfen können.</p>
<p>Bei der anderen Sache hab' ich keine Ahnung. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023697</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:34:39 GMT]]></title><description><![CDATA[<p>Damit mach ich das derzeitig ja, aber das klappt ja eben nicht. Hier ist erstmal der Code zum Transparenten Static:</p>
<pre><code class="language-cpp">case WM_CTLCOLORSTATIC:
    SetTextColor ((HDC)wParam, RGB (255, 255, 255));
    SetBkMode ((HDC)wParam, TRANSPARENT);
return 0;
</code></pre>
<p>In wie weit muss ich den Code abändern, um das zu erreichen?</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023699</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023699</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:34:39 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:40:33 GMT]]></title><description><![CDATA[<p>MSDN schrieb:</p>
<blockquote>
<p>If an application processes this message, the return value is a handle to a brush that the system uses to paint the background of the static control.</p>
</blockquote>
<p>Also nicht</p>
<pre><code class="language-cpp">return 0;
</code></pre>
<p>sondern</p>
<pre><code class="language-cpp">return CreateSolidBrush(0xFFFFFF); // oder welche Farbe auch immer
</code></pre>
<p>sollte funktionieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023700</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023700</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:40:33 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:50:58 GMT]]></title><description><![CDATA[<p>Danke hat geklappt. Ich hatte ursprünglich auch nicht 0 sondern (LRESULT)GetStockObject (NULL_BRUSH)<br />
aber das ist ja eh gleich 0. Jetzt würde ich nur noch wissen wollen, wei ich den Text vertikal zentrieren kann.</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023708</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:50:58 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 13:55:31 GMT]]></title><description><![CDATA[<p>Gibt es auch eine Möglichkeit mehrere Statics verschieden farbig zumachen?</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023709</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 13:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 15:10:35 GMT]]></title><description><![CDATA[<p>Du bekommst ja im lParam das Handle zu dem Static geliefert, welches die Notification gesendet hat, also könntest Du sowas machen:</p>
<pre><code class="language-cpp">if (lParam == hStatic1) {
    return CreateSolidBrush(0xFF0000);
}
if (lParam == hStatic2) {
    return CreateSolidBrush(0x00FF00);
}
...
</code></pre>
<p>Du müsstest dann nur zusehen, dass Du die Handles hStatic1, hStatic2 oder wie auch immer sie heißen in der WndProc zur Verfügung hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023752</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sat, 25 Mar 2006 15:10:35 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 15:14:55 GMT]]></title><description><![CDATA[<p>Danke! Ich hatte das Tutorial auf <a href="http://winapi.net" rel="nofollow">winapi.net</a> gelsen, bin daraus aber nicht schlau geworden. Deshalb habe ich gefragt wie das geht. Jetzt bleibt nur noch die Frage wie ich die vertikal zentrieren kann. Notfalls muss ich eben mit der unschönen Variante \n arbeiten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023758</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 15:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sat, 25 Mar 2006 15:31:02 GMT]]></title><description><![CDATA[<p>Ich musste den Code nur noch ein bisschen umändern, bis es funktioniert hat:</p>
<pre><code class="language-cpp">if (HWND(lParam) == hStatic1) {
    return (LRESULT)CreateSolidBrush(0xFF0000);
}
if (HWND(lParam) == hStatic2) {
    return (LRESULT)CreateSolidBrush(0x00FF00);
}
</code></pre>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1023769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1023769</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sat, 25 Mar 2006 15:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sun, 26 Mar 2006 07:36:51 GMT]]></title><description><![CDATA[<p>mantiz schrieb:</p>
<blockquote>
<p>return CreateSolidBrush(0xFFFFFF); // oder welche Farbe auch immer</p>
</blockquote>
<p>Keine gute Idee. Damit erzeugst du astreine Lecks.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /></p>
<blockquote>
<p>The system does not automatically destroy the returned brush. It is the application's responsibility to destroy the brush when it is no longer needed.</p>
</blockquote>
<p>Lösung:<br />
Erzeuge den Brush in WM_CREATE, ändere diesen, falls du eine andere Farbe brauchst und lösche den Brush in WM_DESTROY.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1024003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1024003</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Sun, 26 Mar 2006 07:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sun, 26 Mar 2006 07:56:49 GMT]]></title><description><![CDATA[<p>groovemaster schrieb:</p>
<blockquote>
<p>Keine gute Idee. Damit erzeugst du astreine Lecks.</p>
</blockquote>
<p>Ups, jo, stimmt, so wäre es besser. <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="😃"
    /></p>
<p>Warum überlese ich eigentlich immer genau diese Sätze in der MSDN? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1024007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1024007</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Sun, 26 Mar 2006 07:56:49 GMT</pubDate></item><item><title><![CDATA[Reply to Statics, die 1.000.000ste on Sun, 26 Mar 2006 10:24:08 GMT]]></title><description><![CDATA[<p>Danke, hab ich gemacht.</p>
<p>Mfg Ominion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1024053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1024053</guid><dc:creator><![CDATA[Ominion]]></dc:creator><pubDate>Sun, 26 Mar 2006 10:24:08 GMT</pubDate></item></channel></rss>