<?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[[CreateProcess] Ermitteln wann Process beendet wurde.]]></title><description><![CDATA[<p>Hallo,</p>
<p>ICh starte eine Process:</p>
<pre><code class="language-cpp">STARTUPINFO si;
      memset(&amp;si, 0, sizeof(si));
      si.cb = sizeof(si);
      si.wShowWindow = SW_SHOWNORMAL;

      PROCESS_INFORMATION pi;

      CreateProcess( sDIR1.c_str(),
                     NULL,
                     NULL,
                     NULL,
                     TRUE,
                     0,
                     NULL,
                     NULL,
                     &amp;si,
                     &amp;pi);
</code></pre>
<p>Ich möchte nun einfach das wenn ich einen Process (z.b C:\\WINDOWS\\Notepad.EXE) öffnet, es nicht weiter geht bevor ich es nicht schließe. Ich muss ja ein Handle auf den Process setzen. Das mache ich ja auch in dem ich BOOL bInheritHandles, auf TRUE setze , oder !? Aber wie kann ich das dann Überprüfen !?</p>
<p>Würde mich über ein Paar Tipps freuen.</p>
<p>Gruß</p>
<p>cube23</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/116296/createprocess-ermitteln-wann-process-beendet-wurde</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 01:57:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/116296.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Jul 2005 15:10:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [CreateProcess] Ermitteln wann Process beendet wurde. on Mon, 25 Jul 2005 15:10:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ICh starte eine Process:</p>
<pre><code class="language-cpp">STARTUPINFO si;
      memset(&amp;si, 0, sizeof(si));
      si.cb = sizeof(si);
      si.wShowWindow = SW_SHOWNORMAL;

      PROCESS_INFORMATION pi;

      CreateProcess( sDIR1.c_str(),
                     NULL,
                     NULL,
                     NULL,
                     TRUE,
                     0,
                     NULL,
                     NULL,
                     &amp;si,
                     &amp;pi);
</code></pre>
<p>Ich möchte nun einfach das wenn ich einen Process (z.b C:\\WINDOWS\\Notepad.EXE) öffnet, es nicht weiter geht bevor ich es nicht schließe. Ich muss ja ein Handle auf den Process setzen. Das mache ich ja auch in dem ich BOOL bInheritHandles, auf TRUE setze , oder !? Aber wie kann ich das dann Überprüfen !?</p>
<p>Würde mich über ein Paar Tipps freuen.</p>
<p>Gruß</p>
<p>cube23</p>
]]></description><link>https://www.c-plusplus.net/forum/post/838393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/838393</guid><dc:creator><![CDATA[cube23]]></dc:creator><pubDate>Mon, 25 Jul 2005 15:10:50 GMT</pubDate></item><item><title><![CDATA[Reply to [CreateProcess] Ermitteln wann Process beendet wurde. on Mon, 25 Jul 2005 15:55:37 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich möchte nun einfach das wenn ich einen Process (z.b C:\\WINDOWS\\Notepad.EXE) öffnet, es nicht weiter geht bevor ich es nicht schließe.</p>
</blockquote>
<p>Ich gehe mal davon aus, dass da ein &quot;nicht&quot; zu viel ist und die warten willst, bis der Prozess beendet ist!?</p>
<pre><code class="language-cpp">BOOL bRet = CreateProcess(&quot;c:\\windows\\system32\\notepad.exe&quot;,NULL,NULL,NULL,TRUE,0,NULL,NULL,&amp;sinfo,&amp;pinfo);

if (!bRet) {
    std::cout &lt;&lt; &quot;Fehler: &quot; &lt;&lt; GetLastError();
}

WaitForSingleObject(pinfo.hProcess,INFINITE);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/838435</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/838435</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Mon, 25 Jul 2005 15:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to [CreateProcess] Ermitteln wann Process beendet wurde. on Mon, 25 Jul 2005 18:10:20 GMT]]></title><description><![CDATA[<p>masterofx32 schrieb:</p>
<blockquote>
<blockquote>
<p>Ich möchte nun einfach das wenn ich einen Process (z.b C:\\WINDOWS\\Notepad.EXE) öffnet, es nicht weiter geht bevor ich es nicht schließe.</p>
</blockquote>
<p>Ich gehe mal davon aus, dass da ein &quot;nicht&quot; zu viel ist und die warten willst, bis der Prozess beendet ist!?</p>
<pre><code class="language-cpp">BOOL bRet = CreateProcess(&quot;c:\\windows\\system32\\notepad.exe&quot;,NULL,NULL,NULL,TRUE,0,NULL,NULL,&amp;sinfo,&amp;pinfo);
	
if (!bRet) {
    std::cout &lt;&lt; &quot;Fehler: &quot; &lt;&lt; GetLastError();
}

WaitForSingleObject(pinfo.hProcess,INFINITE);
</code></pre>
</blockquote>
<p>Hmm irgend wie will das bei mir nicht:</p>
<pre><code class="language-cpp">while(sDIR1 != &quot;ERROR&quot;)
   {
/*
.
.
.
.
.
.*/

      bool bRet = CreateProcess( sDIR1.c_str(),
                     NULL,
                     NULL,
                     NULL,
                     TRUE,
                     0,
                     NULL,
                     NULL,
                     &amp;si,
                     &amp;pi);
      if(!bRet)
      {
      i++;
      }

   }
</code></pre>
<p>Er geht in die while Schleife rein öffnet und dann kommt er zur if abfrage aber da geht er sofort rein und wartet nicht bist der Process beendet wurde.</p>
<p>jemand ne idee !?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/838534</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/838534</guid><dc:creator><![CDATA[cube23]]></dc:creator><pubDate>Mon, 25 Jul 2005 18:10:20 GMT</pubDate></item><item><title><![CDATA[Reply to [CreateProcess] Ermitteln wann Process beendet wurde. on Mon, 25 Jul 2005 18:50:23 GMT]]></title><description><![CDATA[<p>Auf das WaitForSingleObject kommt es an <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/838570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/838570</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 25 Jul 2005 18:50:23 GMT</pubDate></item></channel></rss>