<?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[Setforeground und ein riesen Problem]]></title><description><![CDATA[<p>Ich habe das ja schon im BCB Forum geschrieben, aber das liegt wohl eher an der WinAPI.</p>
<p>Wenn ich ein Programm in Vordergrund holen will klappt das nicht immer.</p>
<p>Folgendes Beispiel, alle Fenster sind grau, aber kein aktives, zumindest laut Getforegroundwindow.</p>
<p>Anderes Beispiel, das Programm wird per SetforegroundWindow versucht in Vordergrund zurufen. Das Programmfenster in der Taskleiste blinkt blau, und Ende.</p>
<p>Ich weiss nicht weiter, und habe schon unzählige Stunden damit zugebracht.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/163352/setforeground-und-ein-riesen-problem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 17:51:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163352.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 28 Oct 2006 18:57:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Setforeground und ein riesen Problem on Sat, 28 Oct 2006 18:57:36 GMT]]></title><description><![CDATA[<p>Ich habe das ja schon im BCB Forum geschrieben, aber das liegt wohl eher an der WinAPI.</p>
<p>Wenn ich ein Programm in Vordergrund holen will klappt das nicht immer.</p>
<p>Folgendes Beispiel, alle Fenster sind grau, aber kein aktives, zumindest laut Getforegroundwindow.</p>
<p>Anderes Beispiel, das Programm wird per SetforegroundWindow versucht in Vordergrund zurufen. Das Programmfenster in der Taskleiste blinkt blau, und Ende.</p>
<p>Ich weiss nicht weiter, und habe schon unzählige Stunden damit zugebracht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163306</guid><dc:creator><![CDATA[the_hero99]]></dc:creator><pubDate>Sat, 28 Oct 2006 18:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to Setforeground und ein riesen Problem on Sun, 29 Oct 2006 00:47:40 GMT]]></title><description><![CDATA[<p>Ich hab die Erfahrung gemacht, das es was bringt wenn man das Fenster vorher via ShowWindow() minimiert und anschließend wieder anzeigen lässt.<br />
Danach scheint man fast immer alle Berechtigungen für SetForegroundWindow() zu haben.<br />
Ist allerdings Gefrickel und funktioniert auch nicht ganz 100%...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163495</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163495</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sun, 29 Oct 2006 00:47:40 GMT</pubDate></item><item><title><![CDATA[Reply to Setforeground und ein riesen Problem on Sun, 29 Oct 2006 00:56:29 GMT]]></title><description><![CDATA[<pre><code>bool SetToForeground(HWND hwnd)
{
	if ( ! hwnd )
		return false;

	DWORD	idThread_foreground = 0;
	DWORD	idThread_me = 0;
	BOOL	retValue = FALSE;

	if ( hwnd == GetForegroundWindow() )
		return true;

	idThread_foreground = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
	idThread_me = GetWindowThreadProcessId(hwnd,NULL);

	if ( idThread_foreground != idThread_me )
	{
		AttachThreadInput(idThread_foreground, idThread_me, TRUE);
		retValue = SetForegroundWindow(hwnd);
		AttachThreadInput(idThread_foreground, idThread_me, FALSE);
 	}
	else
		retValue = SetForegroundWindow(hwnd);

	ShowWindow(hwnd, IsIconic(hwnd) ? SW_RESTORE : SW_SHOW);

	return retValue ? true : false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1163497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163497</guid><dc:creator><![CDATA[_mgs]]></dc:creator><pubDate>Sun, 29 Oct 2006 00:56:29 GMT</pubDate></item><item><title><![CDATA[Reply to Setforeground und ein riesen Problem on Sun, 29 Oct 2006 10:53:50 GMT]]></title><description><![CDATA[<p>Ich bedanke mich recht herzlich, für die Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163627</guid><dc:creator><![CDATA[the_hero99]]></dc:creator><pubDate>Sun, 29 Oct 2006 10:53:50 GMT</pubDate></item></channel></rss>