<?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[don&#x27;t kill me]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich habe von meinem Programm aus eine externe Anwendung (läuft als Win32 Terminal) gestart via <strong>CreateProcess</strong>.</p>
<pre><code class="language-cpp">STARTUPINFO         si;
  PROCESS_INFORMATION pi;

  ...

  CreateProcess(NULL,
                &quot;C:\\pfad\\extern.exe -option&quot;,
                NULL,
                NULL,
                FALSE,
                IDLE_PRIORITY_CLASS | CREATE_NEW_CONSOLE,
                NULL,
                &quot;C:\\pfad\\&quot;,
                &amp;si,
                &amp;pi);
</code></pre>
<p>Mit Programmende möchte ich auch den Prozess wieder schließen. Deshalb habe ich das hier gemacht:</p>
<pre><code class="language-cpp">TerminateProcess(pi.hProcess, 0);
</code></pre>
<p>Das externe Programm muss allerdings noch ein paar Aufräumarbeiten ausführen. <strong>TerminateProcess</strong> scheint aber quasi ein &quot;Linux kill -9&quot; auszuführen und der Prozess wird so schnell platt gemacht, dass keine Zeit mehr zum sauberen Aufräumen bleibt.</p>
<p>Was kann ich tun, damit die Anwendung etwas <strong>softer</strong> gekillt wird (also ein TERM-Signal statt KILL-Signal)??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/65806/don-t-kill-me</link><generator>RSS for Node</generator><lastBuildDate>Fri, 05 Jun 2026 15:42:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/65806.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Feb 2004 15:54:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 15:54:38 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich habe von meinem Programm aus eine externe Anwendung (läuft als Win32 Terminal) gestart via <strong>CreateProcess</strong>.</p>
<pre><code class="language-cpp">STARTUPINFO         si;
  PROCESS_INFORMATION pi;

  ...

  CreateProcess(NULL,
                &quot;C:\\pfad\\extern.exe -option&quot;,
                NULL,
                NULL,
                FALSE,
                IDLE_PRIORITY_CLASS | CREATE_NEW_CONSOLE,
                NULL,
                &quot;C:\\pfad\\&quot;,
                &amp;si,
                &amp;pi);
</code></pre>
<p>Mit Programmende möchte ich auch den Prozess wieder schließen. Deshalb habe ich das hier gemacht:</p>
<pre><code class="language-cpp">TerminateProcess(pi.hProcess, 0);
</code></pre>
<p>Das externe Programm muss allerdings noch ein paar Aufräumarbeiten ausführen. <strong>TerminateProcess</strong> scheint aber quasi ein &quot;Linux kill -9&quot; auszuführen und der Prozess wird so schnell platt gemacht, dass keine Zeit mehr zum sauberen Aufräumen bleibt.</p>
<p>Was kann ich tun, damit die Anwendung etwas <strong>softer</strong> gekillt wird (also ein TERM-Signal statt KILL-Signal)??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465325</guid><dc:creator><![CDATA[Andi]]></dc:creator><pubDate>Sun, 22 Feb 2004 15:54:38 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 16:47:18 GMT]]></title><description><![CDATA[<p>Hi !<br />
Killing me softly ?</p>
<p>Try, CloseHandle(pi.hProcess)</p>
<p>Gruß, J.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465357</guid><dc:creator><![CDATA[J^o^e]]></dc:creator><pubDate>Sun, 22 Feb 2004 16:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 16:58:16 GMT]]></title><description><![CDATA[<p>Das war ein Satz mit &quot;x&quot;...denn hätte ich zwei Zeilen weiter gelesen (MSDN):</p>
<p>...Closing a thread handle does not terminate the associated thread. To remove a thread object, you must terminate the thread, then close all handles to the thread....</p>
<p>Also doch die hard, Terminator-like.</p>
<p>MfG J.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465365</guid><dc:creator><![CDATA[J^o^e]]></dc:creator><pubDate>Sun, 22 Feb 2004 16:58:16 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 19:13:07 GMT]]></title><description><![CDATA[<p>Kannst du die externe Anwendung umschreiben? Ansonsten kann man da wohl nichts machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465393</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465393</guid><dc:creator><![CDATA[????]]></dc:creator><pubDate>Sun, 22 Feb 2004 19:13:07 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 19:49:57 GMT]]></title><description><![CDATA[<p>ExitProcess?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465417</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 22 Feb 2004 19:49:57 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 20:49:28 GMT]]></title><description><![CDATA[<p>Hat das externe Programm geladene *.dll Dateien ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465468</guid><dc:creator><![CDATA[J^o^e]]></dc:creator><pubDate>Sun, 22 Feb 2004 20:49:28 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 20:52:31 GMT]]></title><description><![CDATA[<p>Natürlich. Jedes Programm lädt DLLs!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465474</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 22 Feb 2004 20:52:31 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 21:33:27 GMT]]></title><description><![CDATA[<p>Auszug aus MSDN:</p>
<p>...Terminating a process does not cause child processes to be terminated...<br />
..... A process object is deleted when the last handle to the process is closed .....</p>
<p>Wenn Du also ale childs und handles erwischen kannst, dann sollte das doch ok sein, oder ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465503</guid><dc:creator><![CDATA[J^o^e]]></dc:creator><pubDate>Sun, 22 Feb 2004 21:33:27 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Sun, 22 Feb 2004 21:38:24 GMT]]></title><description><![CDATA[<p>deleted</p>
]]></description><link>https://www.c-plusplus.net/forum/post/465508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/465508</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 22 Feb 2004 21:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to don&#x27;t kill me on Mon, 23 Feb 2004 17:27:18 GMT]]></title><description><![CDATA[<p>ExitProcess wollte ich auch schon probieren, aber damit kann sich ein Prozess ja leider nur selbst beenden.</p>
<p>Ich hab's jetzt einfach so gemacht: via SendInput ein Ctrl-C an die DOS-Box. Das Problem ist ja auch, dass mit einem Schließen des Terminals die Anwendung kein Signal bekommt.<br />
Funktioniert auf jeden Fall prima.</p>
<p>cu + Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/466156</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/466156</guid><dc:creator><![CDATA[Andi]]></dc:creator><pubDate>Mon, 23 Feb 2004 17:27:18 GMT</pubDate></item></channel></rss>