<?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[ShowWindow auf fremde Fenster?]]></title><description><![CDATA[<p>Hi Leute, ich hole mir den HWND eines bestimmten Fenster, und möchte es runterlegen.<br />
Bei eigenen geht das mit ShowWindow, bei fremden funktioniert ShowWindow aber nicht.<br />
Geht das auch per SendMessage?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221866/showwindow-auf-fremde-fenster</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 21:32:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221866.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Sep 2008 13:37:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Thu, 04 Sep 2008 13:37:52 GMT]]></title><description><![CDATA[<p>Hi Leute, ich hole mir den HWND eines bestimmten Fenster, und möchte es runterlegen.<br />
Bei eigenen geht das mit ShowWindow, bei fremden funktioniert ShowWindow aber nicht.<br />
Geht das auch per SendMessage?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576487</guid><dc:creator><![CDATA[Blaze]]></dc:creator><pubDate>Thu, 04 Sep 2008 13:37:52 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Thu, 04 Sep 2008 14:15:03 GMT]]></title><description><![CDATA[<p>Sicher geht das. Zeig mal Code!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576519</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 04 Sep 2008 14:15:03 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Thu, 04 Sep 2008 14:44:06 GMT]]></title><description><![CDATA[<p>Der Kern sieht so aus:</p>
<pre><code class="language-cpp">struct KnownCaptions
	{
		TCHAR *pcClass;
		TCHAR *pcCaption;
		int iCmdShow;
	} aKnownWindows[]=
	{
		NULL, TEXT(&quot;Notifier von Avira AntiVir PersonalEdition Classic&quot;), WM_CLOSE,
		NULL, TEXT(&quot;Notifier von Avira AntiVir Personal - Free Antivirus&quot;), WM_CLOSE,
		NULL, TEXT(&quot;Avira AntiVir Personal - Free Antivirus Updater&quot;), SW_MINIMIZE
	};
	const int iNumKnownWindows= sizeof(aKnownWindows)/sizeof(aKnownWindows[0]);

	HWND hFoundWindow=NULL;
	WINDOWPLACEMENT PlaceMent;
	for(int i=0; i&lt;iNumKnownWindows; ++i)
	{
		if(hFoundWindow=FindWindow(aKnownWindows[i].pcClass,aKnownWindows[i].pcCaption))
		{
			GetWindowPlacement(hFoundWindow,&amp;PlaceMent);
			if(PlaceMent.showCmd != aKnownWindows[i].iCmdShow)
			{
				MessageBeep(MB_ICONASTERISK);				
				if(aKnownWindows[i].iCmdShow == WM_CLOSE)
				{
					SendMessage(hFoundWindow,aKnownWindows[i].iCmdShow,0,0);
					continue;
				}
				ShowWindow(hFoundWindow,aKnownWindows[i].iCmdShow);
				//SendMessage(hFoundWindow,WM_SHOW,aKnownWindows[i].iCmdShow,0);
			}
		}
	}
</code></pre>
<p>Kurze Erklärung:<br />
Als erstes wird eine Liste mit bekannten Fenstern angelegt, und wie darauf reagiert werden soll, dann werden die Fenster einzeln gesucht.<br />
Wenn gefunden, dann wird geprüft ob es geschlossen werden soll, wenn ja, wird WM_CLOSE gesendet.<br />
Ansonsten wird geprüft ob das Fenster nicht schon so ist wie es sein soll (PlaceMent)<br />
Wenn es nicht so ist, wird das versucht mit ShowWindow wieder hinzukriegen.</p>
<p>Beim Werbefenster klappts einwandfrei, aber den Updater runterlegen will's nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576554</guid><dc:creator><![CDATA[Blaze]]></dc:creator><pubDate>Thu, 04 Sep 2008 14:44:06 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Thu, 04 Sep 2008 14:49:23 GMT]]></title><description><![CDATA[<p>Ich glaube, da musst du WM_SIZE senden (bin aber nicht sicher). Nette Idee, übrigens.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576557</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Thu, 04 Sep 2008 14:49:23 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Thu, 04 Sep 2008 15:33:01 GMT]]></title><description><![CDATA[<p>WM_CLOSE ist doch ein ungültiger Wert für ShowWindow! Das ist doch Quatsch. Wenn müsstest Du WM_CLOSE senden!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576600</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 04 Sep 2008 15:33:01 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 06:23:44 GMT]]></title><description><![CDATA[<p>Ich hab mal gelesen, dasss es funktionieren soll, den notifier zu sperren, wenn man von der notifier exe alle dateirechte für alle benutzerkonten löscht (geht aber glaub ich nur bei xp preof)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576891</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Fri, 05 Sep 2008 06:23:44 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 12:20:17 GMT]]></title><description><![CDATA[<p>Die Idee ist interessant. Mit ShowWindow und SendMessage greift man aber nur momentan in ein fremdes Programm ein, ausser man sendet WM_DELETE zum Zerstören. Die Frage läuft wohl darauf hinaus, als 'Administrator' Prioritäten zu vergeben. Hiefür fehlen mir leider die Erfahrungen. Vielleicht kann das jemand anderes erklären.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577103</guid><dc:creator><![CDATA[berniebutt]]></dc:creator><pubDate>Fri, 05 Sep 2008 12:20:17 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 15:31:42 GMT]]></title><description><![CDATA[<p>Frage: Wieso ist hier nur 1 &quot;=&quot; ???</p>
<pre><code class="language-cpp">if(hFoundWindow=FindWindow(aKnownWindows[i].pcClass,aKnownWindows[i].pcCaption))
</code></pre>
<p>Dachte in if() sollte immer &quot;==&quot; stehen...</p>
<p>Ist das vielleicht der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577200</guid><dc:creator><![CDATA[Speedy_92]]></dc:creator><pubDate>Fri, 05 Sep 2008 15:31:42 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 16:40:03 GMT]]></title><description><![CDATA[<p>nein das sollte schon richtig so sein...<br />
das Handle von FindWindow wird hFoundWindow zugewiesen und dann wird hFoundWindow durch das if geprüft</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577213</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 05 Sep 2008 16:40:03 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 16:55:35 GMT]]></title><description><![CDATA[<p>zeugt trotzdem von schlechetem stil.</p>
<p>was spricht den gegen</p>
<pre><code class="language-cpp">hFoundWindow=FindWindow(aKnownWindows[i].pcClass,aKnownWindows[i].pcCaption);
if(hFoundWindow)
{
  ...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1577219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577219</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Fri, 05 Sep 2008 16:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 16:56:06 GMT]]></title><description><![CDATA[<p>red kein blech, das zeugt nicht von schlechtem stil lol.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577220</guid><dc:creator><![CDATA[asdca]]></dc:creator><pubDate>Fri, 05 Sep 2008 16:56:06 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Fri, 05 Sep 2008 18:21:38 GMT]]></title><description><![CDATA[<p>Also WM_SIZE ist es nicht. <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="😞"
    /><br />
Ich bräuchte sowas wie WM_SETSIZE...</p>
<p>Ich hab auch schon SetWindowPlaceMent versucht, bringt nur per GetLastError &quot;Ungültiges Handle!&quot;</p>
<p>PS: Also den Notifier beenden geht, nur kann ich das Updater-Fenster nicht minimieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577240</guid><dc:creator><![CDATA[Blaze]]></dc:creator><pubDate>Fri, 05 Sep 2008 18:21:38 GMT</pubDate></item><item><title><![CDATA[Reply to ShowWindow auf fremde Fenster? on Sat, 06 Sep 2008 07:15:07 GMT]]></title><description><![CDATA[<p>WM_SIZE ist nur eine Benachrichtigung. Wenn Du die Fenstergröße eines Fensters verändern willst musst Du MoveWindow oder SetWindowPos verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1577394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1577394</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 06 Sep 2008 07:15:07 GMT</pubDate></item></channel></rss>