<?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[Transparent Popup Menu]]></title><description><![CDATA[<p>Wie kann man ein Popup Menu Transparent machen?<br />
Ich habe bereits folgenden Code</p>
<pre><code class="language-cpp">bool TrackPopupMenu(CWnd* pWnd, UINT nIDResource, UINT nFlags=TPM_LEFTALIGN|TPM_RIGHTBUTTON)
{
	CPoint CurPos;  CMenu* MMnu = new CMenu();
	if(!MMnu-&gt;LoadMenu(nIDResource)) return false;
	GetCursorPos(&amp;CurPos);
	MMnu-&gt;GetSubMenu(0)-&gt;TrackPopupMenu(nFlags, CurPos.x, CurPos.y, pWnd);
	MMnu-&gt;DestroyMenu();
	delete MMnu;
	return true;
}

BOOL MakeWindowTransparent(HWND hWnd, int value=255)
{
	if(value &gt; 255) value = 255;
	if(value &lt; 0) value = 0;

	typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
	static PSLWA pSetLayeredWindowAttributes = NULL;
	static BOOL initialized = FALSE;
	#define WS_EX_LAYERED           0x00080000    
	#define LWA_COLORKEY            0x00000001
	#define LWA_ALPHA               0x00000002

	HMODULE hDLL = LoadLibrary (&quot;user32&quot;);
    pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL, &quot;SetLayeredWindowAttributes&quot;);
	if(pSetLayeredWindowAttributes == NULL) return FALSE;
	SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
    if(GetLastError()) return FALSE;
    int result = pSetLayeredWindowAttributes (hWnd, RGB(200, 200, 200), (int)(value), LWA_ALPHA);

	return result;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/166027/transparent-popup-menu</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 03:34:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/166027.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Nov 2006 13:11:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Transparent Popup Menu on Sat, 25 Nov 2006 13:11:18 GMT]]></title><description><![CDATA[<p>Wie kann man ein Popup Menu Transparent machen?<br />
Ich habe bereits folgenden Code</p>
<pre><code class="language-cpp">bool TrackPopupMenu(CWnd* pWnd, UINT nIDResource, UINT nFlags=TPM_LEFTALIGN|TPM_RIGHTBUTTON)
{
	CPoint CurPos;  CMenu* MMnu = new CMenu();
	if(!MMnu-&gt;LoadMenu(nIDResource)) return false;
	GetCursorPos(&amp;CurPos);
	MMnu-&gt;GetSubMenu(0)-&gt;TrackPopupMenu(nFlags, CurPos.x, CurPos.y, pWnd);
	MMnu-&gt;DestroyMenu();
	delete MMnu;
	return true;
}

BOOL MakeWindowTransparent(HWND hWnd, int value=255)
{
	if(value &gt; 255) value = 255;
	if(value &lt; 0) value = 0;

	typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
	static PSLWA pSetLayeredWindowAttributes = NULL;
	static BOOL initialized = FALSE;
	#define WS_EX_LAYERED           0x00080000    
	#define LWA_COLORKEY            0x00000001
	#define LWA_ALPHA               0x00000002

	HMODULE hDLL = LoadLibrary (&quot;user32&quot;);
    pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL, &quot;SetLayeredWindowAttributes&quot;);
	if(pSetLayeredWindowAttributes == NULL) return FALSE;
	SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
    if(GetLastError()) return FALSE;
    int result = pSetLayeredWindowAttributes (hWnd, RGB(200, 200, 200), (int)(value), LWA_ALPHA);

	return result;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1181208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1181208</guid><dc:creator><![CDATA[9qu0r45]]></dc:creator><pubDate>Sat, 25 Nov 2006 13:11:18 GMT</pubDate></item><item><title><![CDATA[Reply to Transparent Popup Menu on Sat, 25 Nov 2006 13:38:32 GMT]]></title><description><![CDATA[<p>Gar nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1181228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1181228</guid><dc:creator><![CDATA[antwort]]></dc:creator><pubDate>Sat, 25 Nov 2006 13:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to Transparent Popup Menu on Sat, 25 Nov 2006 13:47:58 GMT]]></title><description><![CDATA[<p>denke das könnte dir weiterhelfen<br />
<a href="http://www.codeproject.com/menu/trans_menu.asp" rel="nofollow">http://www.codeproject.com/menu/trans_menu.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1181231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1181231</guid><dc:creator><![CDATA[LowFly]]></dc:creator><pubDate>Sat, 25 Nov 2006 13:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to Transparent Popup Menu on Sat, 25 Nov 2006 14:00:54 GMT]]></title><description><![CDATA[<p>willst du damit benutzer deiner anwendung ärgern oder was?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1181239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1181239</guid><dc:creator><![CDATA[wtf?]]></dc:creator><pubDate>Sat, 25 Nov 2006 14:00:54 GMT</pubDate></item></channel></rss>