<?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[WaitForSingleObject - Prozessende]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde gerne mit der Funktion WaitForSingleObject auf das Schließen eines Prozesses warten bzw eines Programmes.<br />
Wie/womit mache ich das?<br />
Mit OpenProzess oder womit geht das?</p>
<p>MfG TheCaleb</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/187993/waitforsingleobject-prozessende</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 23:52:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/187993.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Jul 2007 07:10:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 07:10:53 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde gerne mit der Funktion WaitForSingleObject auf das Schließen eines Prozesses warten bzw eines Programmes.<br />
Wie/womit mache ich das?<br />
Mit OpenProzess oder womit geht das?</p>
<p>MfG TheCaleb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332723</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332723</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 07:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 07:21:46 GMT]]></title><description><![CDATA[<p>Ja, OpenProcess() kannst du ein Handle eines bestehenden Prozesses bekommen (vorausgesetzt, du kennst seine Prozess-ID) - und diesen Handle kannst du dann an WaitForSingleObject() übergeben, um auf das Prozessende zu warten.</p>
<p>(nach der Prozess-ID müsstest du das Zielprogramm vermutlich fragen)</p>
<p>PS: Wenn du das Programm selber starten willst, kannst du dazu auch ShellExecuteEx() verwenden, das liefert dir auf Wunsch auch ein Handle auf das gerade geöffnete Programm zurück.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332733</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 26 Jul 2007 07:21:46 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 09:35:10 GMT]]></title><description><![CDATA[<p>Vielen Dank schonmal aber könntest du mir bitte erklären, was ich alles in die SHELLEXECUTEINFO eintragen muss, um das Programm normal zu starten und die ID zu bekommen?<br />
Bzw was muss ich bei dem OpenProcess dann noch angeben, ausser die ID?<br />
Nen Bsp wäre sehr hilfreich!</p>
<p>MfG TheCaleb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332833</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 09:35:10 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 10:02:49 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">typedef struct _SHELLEXECUTEINFO{
    DWORD cbSize;           // Größe der struct - sizeof(SHELLEXECUTEINFO)
    ULONG fMask;            // Flags - du brauchst zumindest SEE_MASK_NOCLOESEPROCESS
    HWND hwnd;              // Window Handle - vermutlich entweder dein eigenes oder NULL
    LPCTSTR lpVerb;         // erwartete Aktion - &quot;open&quot; oder NULL
    LPCTSTR lpFile;         // Name des Zielprogramms
    LPCTSTR lpParameters;   // Parameter für das Zielprogramm
    LPCTSTR lpDirectory;    // Arbeitsverzeichnis
    int nShow;              // Show Flags für Zielprogramm - entweder SW_SHOW oder SW_HIDE
    HINSTANCE hInstApp;     // hier meldet die Funktion mögliche Fehler zurück

    // Optional members 
    LPVOID lpIDList; 
    LPCSTR lpClass; 
    HKEY hkeyClass; 
    DWORD dwHotKey; 
    HANDLE hIcon; 
    HANDLE hProcess;        // und das ist dein Process-Handle
} SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;
</code></pre>
<p>(die übrigen Member kannst du ignorieren)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332867</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 26 Jul 2007 10:02:49 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 10:52:21 GMT]]></title><description><![CDATA[<p>Vielen Dank, kannste mir vlt noch einen Tipp geben?!<br />
Wie kann ich ne Liste mit HANDLE machen?<br />
Also gibt es da ne spezielle Liste, bzw wie kann ich sie nach der Deklaration beliebig vergrößern??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332900</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 10:52:21 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 10:54:51 GMT]]></title><description><![CDATA[<p>Nimm doch einen std::vector&lt;&gt; (oder eine andere Containerklasse - alternativ hat auch die MFC ein paar zur Auswahl), wo du alle Handles reinpacken kannst.</p>
<p>PS: Nur aus Neugierde: wie sieht eigentlich dein Gesamtplan aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332901</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 26 Jul 2007 10:54:51 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 11:03:50 GMT]]></title><description><![CDATA[<p>Ich habe vor ein Programm zu schreiben, welches einen Prozess startet und überwacht.</p>
<p>Son Mist, das mit den Vectoren ist schon ne Weile her, kannste vlt noch Tipps geben?? <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/1332909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332909</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 11:03:50 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 11:05:53 GMT]]></title><description><![CDATA[<p>Wenn du nur einen Prozess überwachen willst, wozu brauchst du dann die Liste?</p>
<p>Zu vector&lt;&gt; empfehle ich einen Blick in meinen Artikel &quot;Aufbau der STL&quot; oder auf <a href="http://www.cppreference.com" rel="nofollow">www.cppreference.com</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332912</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332912</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 26 Jul 2007 11:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 11:21:54 GMT]]></title><description><![CDATA[<p>Und vielen Dank, das soll ja ein dyn Programm sein, also auch für mehr als nur einen Prozess!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332927</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 11:21:54 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 11:45:05 GMT]]></title><description><![CDATA[<p>Also ich bin nun soweit, dass ich der OpenProzess Funktion die ID übergeben möchte, du hast ja geschrieben, dass ich den Handle nehmen soll, doch wie genau muss ich das dann anwednen?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332954</guid><dc:creator><![CDATA[TheCaleb]]></dc:creator><pubDate>Thu, 26 Jul 2007 11:45:05 GMT</pubDate></item><item><title><![CDATA[Reply to WaitForSingleObject - Prozessende on Thu, 26 Jul 2007 12:01:20 GMT]]></title><description><![CDATA[<p>Erstmal brauchst du das nur, um ein Handle zu einem bereits existierenden Prozess zu besorgen (z.B. weil jemand anderes den Prozess angelegt hat). Und dann benötigst du die ID des PRozesses (und ich bin mir nicht sicher, wie du die bekommen kannst). Wenn du alles zusammenhast, kannst du mit</p>
<pre><code class="language-cpp">h = OpenProcess(
        SYNCHRONIZE,//je nach Bedarf kannst du noch weitere Flags setzen
        FALSE,
        theID);
</code></pre>
<p>das zugehörige Handle besorgen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1332973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1332973</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 26 Jul 2007 12:01:20 GMT</pubDate></item></channel></rss>