<?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[Texthintergrund?]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich wollte mal fragen, ob mir jemand sagen kann, wie ich die Hintergrundfarbe von Text ändern kann?</p>
<p>Ich benutze den dev-c++ falls das von bedeutung ist</p>
<p>Danke im VOrraus</p>
<p>MfG Lorun</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/140276/texthintergrund</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 06:16:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/140276.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Mar 2006 16:35:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Texthintergrund? on Mon, 13 Mar 2006 16:35:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich wollte mal fragen, ob mir jemand sagen kann, wie ich die Hintergrundfarbe von Text ändern kann?</p>
<p>Ich benutze den dev-c++ falls das von bedeutung ist</p>
<p>Danke im VOrraus</p>
<p>MfG Lorun</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1015520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1015520</guid><dc:creator><![CDATA[Lorun]]></dc:creator><pubDate>Mon, 13 Mar 2006 16:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Mon, 13 Mar 2006 16:58:39 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>kommt drauf an wie du den text ausgibtst. als static element, als edit-box, mittels drawtext oder textout?</p>
<p>gruss<br />
msp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1015543</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1015543</guid><dc:creator><![CDATA[msp]]></dc:creator><pubDate>Mon, 13 Mar 2006 16:58:39 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Mon, 13 Mar 2006 19:47:21 GMT]]></title><description><![CDATA[<p>Imo benutze ich TextOut.</p>
<p>Aber im prinzip ist es egal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1015678</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1015678</guid><dc:creator><![CDATA[Lorun]]></dc:creator><pubDate>Mon, 13 Mar 2006 19:47:21 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Mon, 13 Mar 2006 21:51:06 GMT]]></title><description><![CDATA[<p>Nö, eigentlich ist es nicht egal. Wenn Du nen static-element oder ne editbox nimmst, dann ist das control dafür verantwortlich und dieses schickt Nachrichten an das Parent-Fenster, wenn es zeichnen will um die Hintergrundfarbe zu erfragen, bei einem Edit-Control z.B. <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/wm_ctlcoloredit.asp" rel="nofollow">WM_CTLCOLOREDIT</a>.<br />
Wenn Du per DrawText oder Textout selbst einen Text ausgibst, dann wird die Hintergrundfarbe des DCs dafür verwendet. Diese kannst Du mit <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_433m.asp" rel="nofollow">SetBkColor</a> ändern. Wenn Du willst, dass der Text mit transparentem Hintergrund auf das bereits gezeichnete ausgeben wird, dann kannst Du mit <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_433m.asp" rel="nofollow">SetBkMode</a> den Hintergrund auf TRANSPARENT setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1015745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1015745</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Mon, 13 Mar 2006 21:51:06 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Tue, 14 Mar 2006 13:29:56 GMT]]></title><description><![CDATA[<p>Ah ok danke^^ hat geklappt nun hab ich ein weiteres Problem :</p>
<p>Und zwar soll im folgenden code die WM_CHAR nachricht ausgelöst werden. das geht auch super, solange ich die WM_COMMAND nicht ausgelöst habe, ich brauch die aber danach^^ ( die funktion die die WM_CHAR erfüllt ist nur zu textzwecken^^ )</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {

	static 	HWND			hClose, hQuadGlei;
			int 			ixKoordButton = 10, iyKoordButton = 10;
			int				iHeight = 25, iWidth = 80;
	static 	RECT			rect;

	switch(message) {
		case WM_CREATE: {
			rect.left 		= 110;
			rect.top 		= 60;
			rect.right		= 670;
			rect.bottom		= 450;

			hClose = CreateWindow(
				&quot;button&quot;,
				&quot;Beenden&quot;,
				WS_CHILD | WS_VISIBLE,
				ixKoordButton,
				iyKoordButton,
				iWidth,
				iHeight,
            	hWnd,
                NULL,
                ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                NULL
			);
			ixKoordButton += 90;
			hQuadGlei = CreateWindow(
				&quot;button&quot;,
				&quot;Quadratische Gleichung&quot;,
				WS_CHILD | WS_VISIBLE,
				ixKoordButton,
				iyKoordButton,
				iWidth + 90,
				iHeight,
            	hWnd,
                NULL,
                ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                NULL
			);				
         	return 0;
		}
		case WM_CHAR: {
			MessageBox(NULL, &quot;NIX&quot;, &quot;Ha, ha, ha, ha...&quot;, MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);	
			return 0;				
		}
		case WM_COMMAND: {
			if ( lParam == (LPARAM)hClose &amp;&amp; HIWORD(wParam) == BN_CLICKED ) {
				PostQuitMessage(0);
			}
			else if ( lParam == (LPARAM)hQuadGlei &amp;&amp; HIWORD(wParam) == BN_CLICKED ) {
				HDC hDC = GetDC(hWnd);

					const char cQuadTopic[] 	= 	&quot;Quadratische Gleichung&quot;;
					DrawText(hDC, cQuadTopic, strlen(cQuadTopic), &amp;rect, DT_CENTER);

					const char cQuadDesc_1[] 	= 	&quot;Form der Gleichung :     ax² + bx + c&quot;;	
					TextOut(hDC, rect.left, rect.top + 40, cQuadDesc_1, strlen(cQuadDesc_1));

					MoveToEx(hDC, rect.left + 30, rect.top + 70, NULL); LineTo(hDC, rect.right - 30, rect.top + 70);

					RoundRect(hDC, rect.left + 130, rect.top + 85, rect.left + 200, rect.top + 110, 10, 10);
					TextOut(hDC, rect.left + 135, rect.top + 90, &quot;a = &quot;, strlen(&quot;a = &quot;));

					RoundRect(hDC, rect.left + 230, rect.top + 85, rect.left + 300, rect.top + 110, 10, 10);
					TextOut(hDC, rect.left + 235, rect.top + 90, &quot;b = &quot;, strlen(&quot;b = &quot;));

					RoundRect(hDC, rect.left + 330, rect.top + 85, rect.left + 400, rect.top + 110, 10, 10);
					TextOut(hDC, rect.left + 335, rect.top + 90, &quot;c = &quot;, strlen(&quot;c = &quot;));
				ReleaseDC(hWnd, hDC);	
			}
			return 0;
		}
		case WM_LBUTTONDOWN: {
			if ( LOWORD(lParam) &lt;= rect.left + 200 &amp;&amp; LOWORD(lParam) &gt;= rect.left + 130 &amp;&amp; HIWORD(lParam) &lt;= rect.top + 110 &amp;&amp; HIWORD(lParam) &gt;= rect.top + 85 ) {			
				bQuadGleiA = true;
			}
			return 0;
		}
		case WM_PAINT: {
			PAINTSTRUCT		ps;
			HDC				hDC;

			hDC = BeginPaint(hWnd, &amp;ps);

				SetBkMode(hDC, TRANSPARENT);

				RoundRect(hDC, 100, 50, 680, 460, 10, 10);

			EndPaint(hWnd, &amp;ps);

			return 0;
		}
		case WM_DESTROY: {
			PostQuitMessage(0);
			return 0;
		}

	}
	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1016049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1016049</guid><dc:creator><![CDATA[Lorun]]></dc:creator><pubDate>Tue, 14 Mar 2006 13:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Wed, 15 Mar 2006 20:44:31 GMT]]></title><description><![CDATA[<p>Lorun schrieb:</p>
<blockquote>
<p>Und zwar soll im folgenden code die WM_CHAR nachricht ausgelöst werden. das geht auch super, solange ich die WM_COMMAND nicht ausgelöst habe, ich brauch die aber danach^^</p>
</blockquote>
<p>Was genau meinst du damit?<br />
BTW: Zeichnen sollte man normalerweise immer nur direkt in WM_PAINT...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017156</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 15 Mar 2006 20:44:31 GMT</pubDate></item><item><title><![CDATA[Reply to Texthintergrund? on Wed, 15 Mar 2006 20:58:28 GMT]]></title><description><![CDATA[<p>flenders schrieb:</p>
<blockquote>
<p>BTW: Zeichnen sollte man normalerweise immer nur direkt in WM_PAINT...</p>
</blockquote>
<p>Jop, oder Du legst Dir einen Memory-DC an, in dem Du dann zeichnen kannst, wann Du willst und blittest in WM_PAINT jeweils immer die Update-Region aus dem Memory-DC in Dein Fenster-DC.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017165</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017165</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Wed, 15 Mar 2006 20:58:28 GMT</pubDate></item></channel></rss>