<?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 Dateien schließen]]></title><description><![CDATA[<p>Ich will ein Programm schreiben, das eine Exe Datei öffnet und diese nach einer gewissen Zeit wieder schließt. Das Programm sieht dann vielleicht ungefähr so aus:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main(int argc, char *argv[])
{

system( &quot;\&quot;Dateipfad\&quot;&quot; );//öffnet die Datei
sleep(1000);//ich weiss nicht, ob man das mit dieser Funktion machen kann?
//und hier sollte die Funktion stehen, die die Datei beendet

  return 0;
}
</code></pre>
<p>Danke im Voraus,</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162935/exe-dateien-schließen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 18:54:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162935.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Oct 2006 14:14:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 14:14:25 GMT]]></title><description><![CDATA[<p>Ich will ein Programm schreiben, das eine Exe Datei öffnet und diese nach einer gewissen Zeit wieder schließt. Das Programm sieht dann vielleicht ungefähr so aus:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

int main(int argc, char *argv[])
{

system( &quot;\&quot;Dateipfad\&quot;&quot; );//öffnet die Datei
sleep(1000);//ich weiss nicht, ob man das mit dieser Funktion machen kann?
//und hier sollte die Funktion stehen, die die Datei beendet

  return 0;
}
</code></pre>
<p>Danke im Voraus,</p>
<p>Felix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160357</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Tue, 24 Oct 2006 14:14:25 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 14:28:54 GMT]]></title><description><![CDATA[<p>Das ist ein Betriebssystemspezifisches Feature.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160377</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 24 Oct 2006 14:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 14:43:13 GMT]]></title><description><![CDATA[<p>Wie würde dann die Funktion bei dem Betriebssystem Windows XP aussehen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160395</guid><dc:creator><![CDATA[Felix15]]></dc:creator><pubDate>Tue, 24 Oct 2006 14:43:13 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 14:55:51 GMT]]></title><description><![CDATA[<p>Du musst komplett auf die System API umsteigen, also die WinAPI bei Windows.</p>
<p>Ich verschieb dich mal ins WinAPI Forum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160416</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Tue, 24 Oct 2006 14:55:51 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 14:56:12 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=547" rel="nofollow">Shade Of Mine</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=10" rel="nofollow">ANSI C</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160417</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160417</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 24 Oct 2006 14:56:12 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 15:26:48 GMT]]></title><description><![CDATA[<p>Das müsste mit CreateProcess und TerminateProcess gehen.</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_and_thread_functions.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_and_thread_functions.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160438</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 24 Oct 2006 15:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 15:37:05 GMT]]></title><description><![CDATA[<p>Ist TerminateProcess eine optimale Variante? Was passiert eigentlich mich Child-Prozessen oder geladenen Dlls wenn man den Prozess abschießt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160451</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160451</guid><dc:creator><![CDATA[Christoph K.]]></dc:creator><pubDate>Tue, 24 Oct 2006 15:37:05 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 15:47:13 GMT]]></title><description><![CDATA[<p>Christoph K. schrieb:</p>
<blockquote>
<p>Ist TerminateProcess eine optimale Variante?</p>
</blockquote>
<p>Kommt drauf an, was du willst. Wenn du möchtest, dass der Prozess beendet wird, dann ja, weil danach ist der Prozess auf jeden Fall weg.<br />
Wenn du möchstest, dass sich das Programm normal beendet, soltest du ihm die entsprechende Nachricht senden und es sich selbst beenden lassen.</p>
<p>Christoph K. schrieb:</p>
<blockquote>
<p>Was passiert eigentlich mich Child-Prozessen oder geladenen Dlls wenn man den Prozess abschießt?</p>
</blockquote>
<p>DLLs solten entladen werden. Kinprozesse müsstest du ausprobieren, würd aber tippen, dass die bestehen bleiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160457</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 24 Oct 2006 15:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Tue, 24 Oct 2006 16:53:27 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39369.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39369.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160528</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Tue, 24 Oct 2006 16:53:27 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 08:30:15 GMT]]></title><description><![CDATA[<p>Sehr hilfreicher Link.<br />
Das Beenden über WM_CLOSE funktioniert auch ausgezeichnet in einer normalen Anwendung. In einem Service jedoch nicht, da schlägt das Beenden fehl. Ich vermute weil der Service vom System und die zu beendende Anwendung vom aktuellen Nutzer gestartet wurde. Bisher habe ich deshalb immer TerminateProcess verwendet. Gibt's für solche Fälle auch eine saubere Lösung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160794</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160794</guid><dc:creator><![CDATA[Morris Szyslak]]></dc:creator><pubDate>Wed, 25 Oct 2006 08:30:15 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 10:53:20 GMT]]></title><description><![CDATA[<p>Ein Service hat kein Fenster. Wer soll da die Nachricht WM_CLOSE entgegennehmen? Eionen Service beednet man mit ControlService und dem Flag SERVICE_CONTROL_STOP.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160901</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 25 Oct 2006 10:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 12:38:00 GMT]]></title><description><![CDATA[<p>Ich habe mich wohl unglücklich ausgedrückt, sorry.<br />
Der Service soll eine Anwendung mit Fenster beenden. Der Service selbst soll nicht beendet werden.</p>
<p>Der von WebFritzi gepostete Code funktioniert, wenn man ihn in einer Anwendung benutzt. In einem Service funktioniert zwar das TerminateProcess, aber ich kann keine (WM_CLOSE-)Nachricht an eine Anwendung senden, weil ich kein Handle auf das Fenster bekomme. Ich habe die Process-ID der Anwendung, aber wie krieg ich das Fensterhandle dazu? Mit EnumWindows erhalte ich nur Handles auf &quot;Fenster&quot; von meinem Service und vier mal svhost.exe.<br />
Hat jemand Ideen dazu?</p>
<p>Bitte um Verzeihung, falls das schon zu Offtopic ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1160976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1160976</guid><dc:creator><![CDATA[Morris Szyslak]]></dc:creator><pubDate>Wed, 25 Oct 2006 12:38:00 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 13:30:26 GMT]]></title><description><![CDATA[<p>Dein Service läuft in einer anderen WindowsStation auf einem anderen Desktop. Deswegen &quot;sieht&quot; dein Service das Fenster nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1161008</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1161008</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Wed, 25 Oct 2006 13:30:26 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 17:09:43 GMT]]></title><description><![CDATA[<p>Morris Szyslak schrieb:</p>
<blockquote>
<p>Sehr hilfreicher Link.<br />
Das Beenden über WM_CLOSE funktioniert auch ausgezeichnet in einer normalen Anwendung. In einem Service jedoch nicht, da schlägt das Beenden fehl. Ich vermute weil der Service vom System und die zu beendende Anwendung vom aktuellen Nutzer gestartet wurde. Bisher habe ich deshalb immer TerminateProcess verwendet. Gibt's für solche Fälle auch eine saubere Lösung?</p>
</blockquote>
<p>Ein Service? Der hat normalerweise kein Fenster, an das Du WM_CLOSE senden kannst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1161182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1161182</guid><dc:creator><![CDATA[helper]]></dc:creator><pubDate>Wed, 25 Oct 2006 17:09:43 GMT</pubDate></item><item><title><![CDATA[Reply to Exe Dateien schließen on Wed, 25 Oct 2006 17:11:14 GMT]]></title><description><![CDATA[<p>helper schrieb:</p>
<blockquote>
<p>Morris Szyslak schrieb:</p>
<blockquote>
<p>Sehr hilfreicher Link.<br />
Das Beenden über WM_CLOSE funktioniert auch ausgezeichnet in einer normalen Anwendung. In einem Service jedoch nicht, da schlägt das Beenden fehl. Ich vermute weil der Service vom System und die zu beendende Anwendung vom aktuellen Nutzer gestartet wurde. Bisher habe ich deshalb immer TerminateProcess verwendet. Gibt's für solche Fälle auch eine saubere Lösung?</p>
</blockquote>
<p>Ein Service? Der hat normalerweise kein Fenster, an das Du WM_CLOSE senden kannst.</p>
</blockquote>
<p>Au Mann, habe ich heute Tomaten auf den Augen, die letzten Beiträge habe ich glatt übersehen. Sorry.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1161185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1161185</guid><dc:creator><![CDATA[helper]]></dc:creator><pubDate>Wed, 25 Oct 2006 17:11:14 GMT</pubDate></item></channel></rss>