<?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[Exe Ausführen und Position und Größe ändern]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe folgenden Code:</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
SHELLEXECUTEINFO sei;
ZeroMemory((PVOID)&amp;sei, sizeof(sei));
// Infostruktur füllen
sei.cbSize = sizeof(sei);
sei.fMask  = SEE_MASK_NOCLOSEPROCESS;
sei.nShow  = SW_SHOW;
sei.lpVerb = TEXT(&quot;open&quot;);
sei.lpFile = TEXT(&quot;C:\\T40Progs\\X29_RC_RG\\x29.exe&quot;); // Name der Applikation
//sei.lpParameters = TEXT(&quot;para&quot;); falls Parameter erforderlich sind
ShellExecuteEx(&amp;sei);
// Test ob Aufruf erfolgreich, sei.hProcess ist dann das Handle der aufgerufenen Applikation
if(sei.hProcess)
{
// Setzen von Position und Größe, Parameter müssen vorher belegt werden
    SetWindowPos(sei.hProcess, HWND_TOP, 500, 0, 200, 200, SWP_NOSIZE);
}
else
ShowMessage(&quot;Fehler&quot;);
}
</code></pre>
<p>Dieser Code öffnet zwar das Programm, ändert aber nicht die Größe und die Position. Was ist hier falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/124508/exe-ausführen-und-position-und-größe-ändern</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 13:07:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124508.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Oct 2005 08:31:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 08:31:29 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe folgenden Code:</p>
<pre><code class="language-cpp">void __fastcall TForm1::Button1Click(TObject *Sender)
{
SHELLEXECUTEINFO sei;
ZeroMemory((PVOID)&amp;sei, sizeof(sei));
// Infostruktur füllen
sei.cbSize = sizeof(sei);
sei.fMask  = SEE_MASK_NOCLOSEPROCESS;
sei.nShow  = SW_SHOW;
sei.lpVerb = TEXT(&quot;open&quot;);
sei.lpFile = TEXT(&quot;C:\\T40Progs\\X29_RC_RG\\x29.exe&quot;); // Name der Applikation
//sei.lpParameters = TEXT(&quot;para&quot;); falls Parameter erforderlich sind
ShellExecuteEx(&amp;sei);
// Test ob Aufruf erfolgreich, sei.hProcess ist dann das Handle der aufgerufenen Applikation
if(sei.hProcess)
{
// Setzen von Position und Größe, Parameter müssen vorher belegt werden
    SetWindowPos(sei.hProcess, HWND_TOP, 500, 0, 200, 200, SWP_NOSIZE);
}
else
ShowMessage(&quot;Fehler&quot;);
}
</code></pre>
<p>Dieser Code öffnet zwar das Programm, ändert aber nicht die Größe und die Position. Was ist hier falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902499</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Fri, 28 Oct 2005 08:31:29 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 08:32:16 GMT]]></title><description><![CDATA[<p>sei.hProcess ist doch kein Fensterhandle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902501</guid><dc:creator><![CDATA[tzzzzzz]]></dc:creator><pubDate>Fri, 28 Oct 2005 08:32:16 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 08:37:37 GMT]]></title><description><![CDATA[<p>Was dann? Sorry, bin noch Anfänger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902505</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Fri, 28 Oct 2005 08:37:37 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 08:40:31 GMT]]></title><description><![CDATA[<p>FindWindow könnte dir helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902506</guid><dc:creator><![CDATA[hinweis]]></dc:creator><pubDate>Fri, 28 Oct 2005 08:40:31 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 09:54:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">SHELLEXECUTEINFO sei;
ZeroMemory((PVOID)&amp;sei, sizeof(sei));
// Infostruktur füllen
sei.cbSize = sizeof(sei);
sei.hwnd = TEXT(&quot;Bla&quot;);
sei.fMask  = SEE_MASK_NOCLOSEPROCESS;
sei.nShow  = SW_SHOW;
sei.lpVerb = TEXT(&quot;open&quot;);
sei.lpFile = TEXT(&quot;C:\\T40Progs\\X29_RC_RG\\x29.exe&quot;); // Name der Applikation
//sei.lpParameters = TEXT(&quot;para&quot;); falls Parameter erforderlich sind
ShellExecuteEx(&amp;sei);
// Test ob Aufruf erfolgreich, sei.hProcess ist dann das Handle der aufgerufenen Applikation
if(sei.hProcess)
{
// Setzen von Position und Größe, Parameter müssen vorher belegt werden
    SetWindowPos(FindWindow(sei.lpClass, NULL) , NULL, 500, 0, 200, 200, SWP_SHOWWINDOW);
}
else
ShowMessage(&quot;Fehler&quot;);
</code></pre>
<p>Habs so probiert, was muss ich da ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902589</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Fri, 28 Oct 2005 09:54:34 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Fri, 28 Oct 2005 19:20:07 GMT]]></title><description><![CDATA[<p>Ich blicke den lpClass Parameter zwar auch nicht so ganz <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> - aber ich denke, dass der nicht dafür da ist (also du damit nicht den Namen der Fensterklasse bekommst). Diesen ermittelst du wohl am einfachsten mit Spy++ bzw. WinSpector <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/903065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903065</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 28 Oct 2005 19:20:07 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Sat, 29 Oct 2005 12:27:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/10681">@MartinN</a><br />
du könntest vielleicht noch createprocess mit den entsprechenden infos starten<br />
STARTF_USEPOSITION | STARTF_USESIZE | usw geht allerdings nur wenn default werte gesetzt sind.<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp</a><br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/startupinfo_str.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/startupinfo_str.asp</a><br />
ansonsten wie schon gesagt wurde mit<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindow.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindow.asp</a></p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/1644">@flenders</a><br />
mit ging es ähnlich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> sicher bin ich mir das man nicht den klassennamen bekommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/903349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903349</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Sat, 29 Oct 2005 12:27:34 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Sat, 29 Oct 2005 16:45:02 GMT]]></title><description><![CDATA[<p>die fensterposition eines anderen prozesses kann man normalerweise garnicht beeinflussen. die wird vom anderen prozess gesetzt. die fensterklassen sind prozesslokal und können auch nicht von anderen prozessen genutzt werden.</p>
<p>wenn du die fensterposition eines anderen prozesses beeinflussen willst, dann geht das nur, wenn der andere prozess dafür eine schnittstelle vorsieht. zB befehlszeilenparameter oder registry-einträge. eine methode, die mit allen prozessen funktioniert, gibt es nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/903488</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903488</guid><dc:creator><![CDATA[Konfusius]]></dc:creator><pubDate>Sat, 29 Oct 2005 16:45:02 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Sat, 29 Oct 2005 17:47:10 GMT]]></title><description><![CDATA[<p>Konfusius schrieb:</p>
<blockquote>
<p>die fensterposition eines anderen prozesses kann man normalerweise garnicht beeinflussen. die wird vom anderen prozess gesetzt. die fensterklassen sind prozesslokal und können auch nicht von anderen prozessen genutzt werden.</p>
<p>wenn du die fensterposition eines anderen prozesses beeinflussen willst, dann geht das nur, wenn der andere prozess dafür eine schnittstelle vorsieht. zB befehlszeilenparameter oder registry-einträge. eine methode, die mit allen prozessen funktioniert, gibt es nicht.</p>
</blockquote>
<p>Alles falsch.</p>
<p>[edit]ah, halt: &quot;die [Fensterposition] wird vom anderen prozess gesetzt&quot;, das stimmt[/edit]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/903517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903517</guid><dc:creator><![CDATA[D*niel *chumann]]></dc:creator><pubDate>Sat, 29 Oct 2005 17:47:10 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Mon, 31 Oct 2005 00:18:31 GMT]]></title><description><![CDATA[<p>Schon mal drann gedacht das hProcess die HInstance ist des processes ist und man darüber leicht alle fenster (elemente) Enumieren kann!<br />
Ansonsten kenne ich son Typen der das gut erklären kann, MSDN heißt der glaub ich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/904240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/904240</guid><dc:creator><![CDATA[Antworteich]]></dc:creator><pubDate>Mon, 31 Oct 2005 00:18:31 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Wed, 02 Nov 2005 07:15:18 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/10681">@MartinN</a><br />
du könntest vielleicht noch createprocess mit den entsprechenden infos starten<br />
STARTF_USEPOSITION | STARTF_USESIZE | usw geht allerdings nur wenn default werte gesetzt sind.<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp</a><br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/startupinfo_str.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/startupinfo_str.asp</a></p>
</blockquote>
<p>Also ich hab das jetzt so gemacht:</p>
<pre><code class="language-cpp">void StartApp(AnsiString ProgPfad)
{
stgStartupInfo.dwX = 500;
stgStartupInfo.dwY = 10;
stgStartupInfo.dwXSize = 1000;
stgStartupInfo.dwYSize = 20;
setmem(&amp;stgStartupInfo, sizeof(TStartupInfo),0);
stgStartupInfo.cb = sizeof(TStartupInfo);
CreateProcess(NULL, ProgPfad.c_str(), NULL, NULL, true,
        NORMAL_PRIORITY_CLASS, NULL, ExtractFilePath(ProgPfad).c_str(),
        &amp;stgStartupInfo, &amp;stgProcessInfo);
}
</code></pre>
<p>Funktioniert leider nicht, vermutlich wegen den default werten.<br />
Welche werte muss ich da noch setzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/906154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/906154</guid><dc:creator><![CDATA[MartinN]]></dc:creator><pubDate>Wed, 02 Nov 2005 07:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Ausführen und Position und Größe ändern on Wed, 02 Nov 2005 20:27:01 GMT]]></title><description><![CDATA[<p>Du musst wohl zumindest in stgStartupInfo bei dwFlags noch STARTF_USEPOSITION und STARTF_USESIZE angeben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/906795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/906795</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 02 Nov 2005 20:27:01 GMT</pubDate></item></channel></rss>