<?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[Problem mit UpdateLayeredWindow]]></title><description><![CDATA[<p>Ich experimentiere im Moment ein bisschen mit Layered Windows. Ich habe schon transparente Fenster mit SetLayeredWindowAttributes gemacht und will jetzt auch mal ein Bild auf dem Fenster anzeigen lassen. Allerdings ist das Fenster immer unsichtbar, nachdem ich UpdateLayeredWindow angewendet habe.</p>
<p>Hier der Codeausschnitt:</p>
<pre><code class="language-cpp">HWND window = CreateWindowEx( WS_EX_LAYERED, &quot;windowclass&quot;, &quot;Fenster&quot;, WS_VISIBLE | WS_POPUP, 100, 100, 400, 300, 0, 0, GetModuleHandle( 0 ), 0 );

	POINT sPoint = { 100, 100 };
	SIZE sSize = { 400, 300 };
	POINT sSrc = { 0, 0 };

	BLENDFUNCTION sBlend;
	sBlend.AlphaFormat = AC_SRC_ALPHA;
	sBlend.BlendOp = AC_SRC_OVER;
	sBlend.BlendFlags = 0;
	sBlend.SourceConstantAlpha = 255;

	HDC hScreenDC = GetDC( 0 );
	HDC hMemoryDC = CreateCompatibleDC( hScreenDC );

	HBITMAP hBitmap = ( HBITMAP )LoadImage( GetModuleHandle( 0 ), &quot;bitmap.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
	SelectObject( hMemoryDC, hBitmap );

	HRESULT hRes = UpdateLayeredWindow( window, hScreenDC, &amp;sPoint, &amp;sSize, hMemoryDC, &amp;sSrc, 0, &amp;sBlend, ULW_ALPHA );
</code></pre>
<p>Ich hab keine Ahnung, warum es nicht funktioniert. <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/topic/196581/problem-mit-updatelayeredwindow</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 01:46:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196581.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Oct 2007 13:58:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit UpdateLayeredWindow on Wed, 31 Oct 2007 13:58:00 GMT]]></title><description><![CDATA[<p>Ich experimentiere im Moment ein bisschen mit Layered Windows. Ich habe schon transparente Fenster mit SetLayeredWindowAttributes gemacht und will jetzt auch mal ein Bild auf dem Fenster anzeigen lassen. Allerdings ist das Fenster immer unsichtbar, nachdem ich UpdateLayeredWindow angewendet habe.</p>
<p>Hier der Codeausschnitt:</p>
<pre><code class="language-cpp">HWND window = CreateWindowEx( WS_EX_LAYERED, &quot;windowclass&quot;, &quot;Fenster&quot;, WS_VISIBLE | WS_POPUP, 100, 100, 400, 300, 0, 0, GetModuleHandle( 0 ), 0 );

	POINT sPoint = { 100, 100 };
	SIZE sSize = { 400, 300 };
	POINT sSrc = { 0, 0 };

	BLENDFUNCTION sBlend;
	sBlend.AlphaFormat = AC_SRC_ALPHA;
	sBlend.BlendOp = AC_SRC_OVER;
	sBlend.BlendFlags = 0;
	sBlend.SourceConstantAlpha = 255;

	HDC hScreenDC = GetDC( 0 );
	HDC hMemoryDC = CreateCompatibleDC( hScreenDC );

	HBITMAP hBitmap = ( HBITMAP )LoadImage( GetModuleHandle( 0 ), &quot;bitmap.bmp&quot;, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
	SelectObject( hMemoryDC, hBitmap );

	HRESULT hRes = UpdateLayeredWindow( window, hScreenDC, &amp;sPoint, &amp;sSize, hMemoryDC, &amp;sSrc, 0, &amp;sBlend, ULW_ALPHA );
</code></pre>
<p>Ich hab keine Ahnung, warum es nicht funktioniert. <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/1395242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395242</guid><dc:creator><![CDATA[ChRiS!]]></dc:creator><pubDate>Wed, 31 Oct 2007 13:58:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit UpdateLayeredWindow on Thu, 01 Nov 2007 18:11:33 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>probier mal:</p>
<pre><code>HDC hMemoryDC = CreateCompatibleDC(NULL)
</code></pre>
<p>Verwendest du ein 32-Bit-Bild?<br />
Hast du die Farben schon mit deren Alphawert vormultipliziert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1396021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396021</guid><dc:creator><![CDATA[GastVonHeute]]></dc:creator><pubDate>Thu, 01 Nov 2007 18:11:33 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit UpdateLayeredWindow on Fri, 02 Nov 2007 09:18:16 GMT]]></title><description><![CDATA[<p>Danke für Deine Antwort.<br />
Mit CreateCompatibleDC( NULL ) geht es aber leider auch nicht.<br />
Ich verwende eine 24-Bit Bitmap und was meinst Du mit Vormultiplizieren? <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/1396255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1396255</guid><dc:creator><![CDATA[ChRiS!]]></dc:creator><pubDate>Fri, 02 Nov 2007 09:18:16 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit UpdateLayeredWindow on Sun, 04 Nov 2007 12:17:55 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>UpdateLayeredWindow() macht ja nur Sinn, wenn deine Bitmap einen Alphakanal besitzt. Sonst könntest du die Bitmap einfach nur blitten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1397421</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1397421</guid><dc:creator><![CDATA[GastVonHeute]]></dc:creator><pubDate>Sun, 04 Nov 2007 12:17:55 GMT</pubDate></item></channel></rss>