<?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[Probleme mit SetWindowPos]]></title><description><![CDATA[<p>Hi Allerseits!</p>
<p>Ich habe ein Verständnisproblem mit der Funktion SetWindowPos. Ich möchte ein Fenster, dessen Handle ich habe im Code an eine beliebige andere Stelle auf dem Dektop verschieben.</p>
<pre><code class="language-cpp">HWND  hWindow = NULL;

     AnsiString sWindowName = lbGetWindows-&gt;Items-&gt;Strings[lbGetWindows-&gt;ItemIndex];

     hWindow = FindWindow(NULL, sWindowName.c_str());

     if (hWindow) SetWindowPos(hWindow, HWND_BOTTOM, 0, 0, 640, 480, SWP_SHOWWINDOW);
</code></pre>
<p>Anstatt mir das eigentliche Fenster, was ich verschieben will, richtig zu setzen wird ein neues transparentes Fenster an die angegebenen Koordinaten gemalt und das ürsprüngliche bleibt an seiner Stelle. Das neu erzeugte Fenster kann man nur schließen (Schließenkreutz) und gleichzeitig wird dann auch das Ursprungsfenter mit geschlossen ... Wie kann ich es also anstellen, dass das entsprechende Fenster ohne Murren seine Postition wechselt?</p>
<p>F98</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/81208/probleme-mit-setwindowpos</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 11:27:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/81208.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jul 2004 08:35:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 08:35:57 GMT]]></title><description><![CDATA[<p>Hi Allerseits!</p>
<p>Ich habe ein Verständnisproblem mit der Funktion SetWindowPos. Ich möchte ein Fenster, dessen Handle ich habe im Code an eine beliebige andere Stelle auf dem Dektop verschieben.</p>
<pre><code class="language-cpp">HWND  hWindow = NULL;

     AnsiString sWindowName = lbGetWindows-&gt;Items-&gt;Strings[lbGetWindows-&gt;ItemIndex];

     hWindow = FindWindow(NULL, sWindowName.c_str());

     if (hWindow) SetWindowPos(hWindow, HWND_BOTTOM, 0, 0, 640, 480, SWP_SHOWWINDOW);
</code></pre>
<p>Anstatt mir das eigentliche Fenster, was ich verschieben will, richtig zu setzen wird ein neues transparentes Fenster an die angegebenen Koordinaten gemalt und das ürsprüngliche bleibt an seiner Stelle. Das neu erzeugte Fenster kann man nur schließen (Schließenkreutz) und gleichzeitig wird dann auch das Ursprungsfenter mit geschlossen ... Wie kann ich es also anstellen, dass das entsprechende Fenster ohne Murren seine Postition wechselt?</p>
<p>F98</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570726</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 08:35:57 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 08:50:45 GMT]]></title><description><![CDATA[<p>probier mal MoveWindow()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570743</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570743</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Thu, 29 Jul 2004 08:50:45 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 08:51:52 GMT]]></title><description><![CDATA[<p>Dann hast du bestimmt ein Handle auf das falsche Fenster!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570744</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570744</guid><dc:creator><![CDATA[100%]]></dc:creator><pubDate>Thu, 29 Jul 2004 08:51:52 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:00:27 GMT]]></title><description><![CDATA[<p>MoveWindow oder SetWindowPlacement produzieren das selbe Ergebnis. Findwindow liefert mir aber ein gültiges Handle, das sollte doch stimmen, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570745</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:00:27 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:00:37 GMT]]></title><description><![CDATA[<p>Dann kann es nur am Handle liegen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570749</guid><dc:creator><![CDATA[bla bla]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:00:37 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:01:46 GMT]]></title><description><![CDATA[<p>dann hast du wohl ein fensterchen, dass auf sehr unkonventionelle weise seinen inhalt malt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/570750</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570750</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:01:46 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:02:09 GMT]]></title><description><![CDATA[<p>Ich habe ja nicht gesagt das das Handle ungültig ist, sondern es auf ein anderes Fenster zeigt.</p>
<p>Welches Programm willst du denn steueren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570751</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570751</guid><dc:creator><![CDATA[100%]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:02:09 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:03:20 GMT]]></title><description><![CDATA[<p>Hm irgendwie scheint doch das Handle falsch zu sein, denn GetWindowPlacement liefert ungültige Werte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570752</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:03:20 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:06:05 GMT]]></title><description><![CDATA[<p>Nimm mal das Programm:</p>
<p><a href="http://assarbad.net/stuff/eda_preview270.exe" rel="nofollow">http://assarbad.net/stuff/eda_preview270.exe</a></p>
<p>Um dich über das Fenster zu informieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570756</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570756</guid><dc:creator><![CDATA[eda]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:06:05 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:16:37 GMT]]></title><description><![CDATA[<p>Erstaunlicherweise kann man das MSM-Fenster auf die Art verschieben lassen, beim BCB oder der Anwendung selbt geht das nicht. Liegt das an gewissen Fenstereigenschaften?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570761</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:16:37 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 09:28:40 GMT]]></title><description><![CDATA[<p>Kannst du mal eine Anwendung hochladen, wo sich das Fenster nicht in der Position ändern lässt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570769</guid><dc:creator><![CDATA[??????]]></dc:creator><pubDate>Thu, 29 Jul 2004 09:28:40 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 11:05:29 GMT]]></title><description><![CDATA[<p>So, Test-Anwendung liegt bei: <a href="http://fatman98.funpic.de/Data/" rel="nofollow">WindowInfo</a>.</p>
<p>Wenn man zum Beispiel das Fenster von WindowInfo selbst auswählt wird von FindWindow ein anderes handle zurückgegeben als von dem eda-preview-tool. <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/570868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570868</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 11:05:29 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit SetWindowPos on Thu, 29 Jul 2004 11:22:57 GMT]]></title><description><![CDATA[<p>Ok. Ich weis jetzt wo der Hund begraben liegt. Der Anwendungsname in der Taskbar und die Fenster-Caption müssen gleich sein.</p>
<p>Meine TestAnwendung hat als Namen in der Taskbar &quot;Window Killer&quot; stehen, das Formular selbst heißt aber &quot;Test&quot;. Meine CallBackFunktion zum Enumerieren der Fenster liefert nicht die Caption des Hauptfensters sondern den Anwendungsnamen zurück:</p>
<pre><code class="language-cpp">BOOL CALLBACK EnumWindowsProc (HWND hwnd, LPARAM lParam)
{
    WINDOWPLACEMENT wp;
    char Caption[255];

    if(!GetWindow(hwnd, GW_OWNER) &amp;&amp; IsWindowVisible(hwnd))
    {
        GetWindowText(hwnd, Caption, 255);
        GetWindowPlacement(hwnd, &amp;wp);

        if (wp.showCmd != SW_HIDE &amp;&amp; strcmp(&quot;&quot;, Caption) != 0)
        {
            frmMain-&gt;lbGetWindows-&gt;Items-&gt;Add(Caption);
        }
    }

    return true;
}
</code></pre>
<p>Klar, dass dann aufgrund des falschen Namens in der Listbox ein inkorrektes handle erzeugt wird.</p>
<p>Trotzdem danke an alle, die sich wegen mir eine Birne gemacht haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/570891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/570891</guid><dc:creator><![CDATA[F98]]></dc:creator><pubDate>Thu, 29 Jul 2004 11:22:57 GMT</pubDate></item></channel></rss>