<?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[Ownerdraw von Staic-Frames]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte einen Static-SS_GRAYFRAME selber &quot;zeichen&quot;. Leider funktioniert das nicht so, wie ich es möchte:</p>
<pre><code class="language-cpp">case WM_DRAWITEM:
		if(static_cast&lt;DWORD&gt;(GetWindowLongPtr(reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;hwndItem, GWL_STYLE)) &amp; SS_GRAYFRAME)
		{
			for(i=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.left;i&lt;=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.right;i++)
			{
				for(j=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.top; j&lt;=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.bottom;j++)
				{
					SetPixel(GetDC(hWnd), i, j, RGB(210, 210, 210));
				}
			}
		}
		break;
</code></pre>
<p>Es wird einfach gar nichts gezeichnet. Der Bereich, wo eigentlich der Rahmen (bzw. in meinem Fall das Rechteck) sein müsste, bleibt Transparent.</p>
<p>Hat jemand eine Idee, was falsch ist?</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/87031/ownerdraw-von-staic-frames</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 20:14:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/87031.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Sep 2004 09:50:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 09:54:29 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich möchte einen Static-SS_GRAYFRAME selber &quot;zeichen&quot;. Leider funktioniert das nicht so, wie ich es möchte:</p>
<pre><code class="language-cpp">case WM_DRAWITEM:
		if(static_cast&lt;DWORD&gt;(GetWindowLongPtr(reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;hwndItem, GWL_STYLE)) &amp; SS_GRAYFRAME)
		{
			for(i=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.left;i&lt;=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.right;i++)
			{
				for(j=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.top; j&lt;=reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem.bottom;j++)
				{
					SetPixel(GetDC(hWnd), i, j, RGB(210, 210, 210));
				}
			}
		}
		break;
</code></pre>
<p>Es wird einfach gar nichts gezeichnet. Der Bereich, wo eigentlich der Rahmen (bzw. in meinem Fall das Rechteck) sein müsste, bleibt Transparent.</p>
<p>Hat jemand eine Idee, was falsch ist?</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614625</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 25 Sep 2004 09:54:29 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 10:01:05 GMT]]></title><description><![CDATA[<p>Wartet mal. Ich glaube, ich habe den Fehler selbst jetzt gefunden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614630</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 25 Sep 2004 10:01:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 10:07:12 GMT]]></title><description><![CDATA[<p>Es wäre von allgemeinem Nutzen wenn du auch noch verraten würdest, was zur Lösung deines Problems geführt hat. Meinst du nicht auch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614633</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sat, 25 Sep 2004 10:07:12 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 10:16:48 GMT]]></title><description><![CDATA[<p>Ja, meine ich auch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Leider habe ich gar keine Lösung. Es war gerade eben eher so ein Gedanke.</p>
<p>Erstmal SetPixel ist sch... . SetPixel ist eine unglaublich langsame Funktion, und nach jedem Aufruf von SetPixel wird das Fenster neu gezeichnet (glaube ich). Also bringt SetPixel nicht so viel. (Von der Performance her)</p>
<p>Einfacher wäre es wohl mit PatBlt oder FillRect, aber leider funktioniert das nicht, und ich habe keine Ahnung warum.</p>
<p>Mein Code:</p>
<pre><code class="language-cpp">if(!FillRect(GetDC(hWnd), &amp;reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(LParam)-&gt;rcItem, g_hBrush))
				WINAPI_ERR(&quot;!FillRect&quot;, -1);
</code></pre>
<p>Der Bereich, wo eigentlich das graue Rechteck sein sollte ist Transparent...</p>
<p>Weiß jemand, woran das liegen könnte,</p>
<p>danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614642</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 25 Sep 2004 10:16:48 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 10:28:29 GMT]]></title><description><![CDATA[<p>Probier mal mit der folgenden Funktion herauszufinden was Windows selbst über den Fehler, der durch den Aufruf dieser Funktion auftritt, sagt:</p>
<pre><code class="language-cpp">void ErrorMsgBox()
{
  LPVOID lpMsgBuf;
  FormatMessage(
    FORMAT_MESSAGE_ALLOCATE_BUFFER |
    FORMAT_MESSAGE_FROM_SYSTEM |
    FORMAT_MESSAGE_IGNORE_INSERTS,
    NULL,
    GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    (LPTSTR) &amp;lpMsgBuf,
    0,
    NULL
  );
  MessageBox( NULL, (LPCTSTR)lpMsgBuf, TEXT(&quot;Error&quot;), MB_OK | MB_ICONERROR );
  LocalFree( lpMsgBuf );
}
</code></pre>
<p>Oder wird FillRect eh erfolgreich ausgeführt?</p>
<p>Noch eine Frage: Ist g_hBrush gültig`? Was weist du ihr zu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614646</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sat, 25 Sep 2004 10:28:29 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 11:05:49 GMT]]></title><description><![CDATA[<p>Nee,</p>
<p>GetLastError() ist 0 (sonst würde ein ASSERT-Makro &quot;aufgerufen&quot;), und der Brush ist damit gülltig.</p>
<p>Den Brush Initallisiere ich so:</p>
<pre><code class="language-cpp">g_hBrush = CreateSolidBrush(RGB(230, 230, 230));
	if(!g_hBrush)
		WINAPI_ERR(&quot;!g_hBrush&quot;, -1);
</code></pre>
<p>Ich hoffe auf Hilfe,</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614659</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614659</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 25 Sep 2004 11:05:49 GMT</pubDate></item><item><title><![CDATA[Reply to Ownerdraw von Staic-Frames on Sat, 25 Sep 2004 11:27:27 GMT]]></title><description><![CDATA[<p>Naja, vielleicht kann man mein Problem auch anders Lösen.</p>
<p>Eigentlich möchte ich erreichen, dass der Innenteil eines Frames (also das, was zwischen den 4 Frame-Linien ist) transparent wird. Leider funktioniert das durch das Abfangen der Nachrichten WM_CTL_COLORSTATIC und dem Setzen von SetBkMode(TRANSPARENT) nicht. Warum weiß ich nicht, da es bei ganz normalen Static-Labels funktioniert.</p>
<p>Wenn ich erreichen könnte, das der Innenteil des Frames transparent wird, bräuchte ich mich nicht mehr mit den ganzen Gdi-Funktionen herumzuschlagen und das Problem wäre gelöst.</p>
<p>Danke,</p>
<p>Chrissi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/614675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/614675</guid><dc:creator><![CDATA[*chrissi]]></dc:creator><pubDate>Sat, 25 Sep 2004 11:27:27 GMT</pubDate></item></channel></rss>