<?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[Noch einmal CreateProcess - NICHT als Child?!]]></title><description><![CDATA[<p>Hi!</p>
<p>Sorry, ich stehe auf dem Schlauch und nach dem 20. CreateProcess-Thread habe ich dann aufgegeben.<br />
Ich möchte einen Prozess mit CreateProcess() starten (benutze im Moment WinExec).<br />
Das ganze soll minimiert und <strong>*nicht* als Child-Prozess</strong> passieren.<br />
Letzteres bekomme ich nicht hin.<br />
Bitte schiebt mich doch mal in die korrekte Richtung, nach Möglichkeit mit etwas Code, weil ich ja noch nicht sooo sattelfest bin:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;tchar.h&gt;

void _tmain( int argc, TCHAR *argv[] )
{
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &amp;si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &amp;pi, sizeof(pi) );

    if( argc != 2 )
    {
        printf(&quot;Usage: %s [cmdline]\n&quot;, argv[0]);
        return;
    }

[b]    si.dwFlags = STARTF_USESHOWWINDOW; // Minimiert
    si.wShowWindow = SW_MINIMIZE; // Minimiert
[/b]
    // Start the child process. 
    if( !CreateProcess( NULL,   // No module name (use command line)
        argv[1],        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        TRUE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &amp;si,            // Pointer to STARTUPINFO structure
        &amp;pi )           // Pointer to PROCESS_INFORMATION structure
    ) 
    {
        printf( &quot;CreateProcess failed (%d)\n&quot;, GetLastError() );
        return;
    }

    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );

    // Close process and thread handles. 
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
}
</code></pre>
<p>Daaanke. PS: Ich habe wirklich gesucht!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/181619/noch-einmal-createprocess-nicht-als-child</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 10:39:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/181619.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 May 2007 15:45:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 15:45:10 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Sorry, ich stehe auf dem Schlauch und nach dem 20. CreateProcess-Thread habe ich dann aufgegeben.<br />
Ich möchte einen Prozess mit CreateProcess() starten (benutze im Moment WinExec).<br />
Das ganze soll minimiert und <strong>*nicht* als Child-Prozess</strong> passieren.<br />
Letzteres bekomme ich nicht hin.<br />
Bitte schiebt mich doch mal in die korrekte Richtung, nach Möglichkeit mit etwas Code, weil ich ja noch nicht sooo sattelfest bin:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;tchar.h&gt;

void _tmain( int argc, TCHAR *argv[] )
{
    STARTUPINFO si;
    PROCESS_INFORMATION pi;

    ZeroMemory( &amp;si, sizeof(si) );
    si.cb = sizeof(si);
    ZeroMemory( &amp;pi, sizeof(pi) );

    if( argc != 2 )
    {
        printf(&quot;Usage: %s [cmdline]\n&quot;, argv[0]);
        return;
    }

[b]    si.dwFlags = STARTF_USESHOWWINDOW; // Minimiert
    si.wShowWindow = SW_MINIMIZE; // Minimiert
[/b]
    // Start the child process. 
    if( !CreateProcess( NULL,   // No module name (use command line)
        argv[1],        // Command line
        NULL,           // Process handle not inheritable
        NULL,           // Thread handle not inheritable
        TRUE,          // Set handle inheritance to FALSE
        0,              // No creation flags
        NULL,           // Use parent's environment block
        NULL,           // Use parent's starting directory 
        &amp;si,            // Pointer to STARTUPINFO structure
        &amp;pi )           // Pointer to PROCESS_INFORMATION structure
    ) 
    {
        printf( &quot;CreateProcess failed (%d)\n&quot;, GetLastError() );
        return;
    }

    // Wait until child process exits.
    WaitForSingleObject( pi.hProcess, INFINITE );

    // Close process and thread handles. 
    CloseHandle( pi.hProcess );
    CloseHandle( pi.hThread );
}
</code></pre>
<p>Daaanke. PS: Ich habe wirklich gesucht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285511</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 15 May 2007 15:45:10 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 15:49:25 GMT]]></title><description><![CDATA[<p>Bist du dir sicher das das überhaupt geht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285514</guid><dc:creator><![CDATA[ps]]></dc:creator><pubDate>Tue, 15 May 2007 15:49:25 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 16:08:20 GMT]]></title><description><![CDATA[<p>Bei MSDN habe ich davon gelesen, allerdings habe die der 'Einfachheit halber' das Beispiel mit einem Child-Prozess gezeigt... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285528</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 15 May 2007 16:08:20 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 16:19:03 GMT]]></title><description><![CDATA[<p>Was verstehst Du unter &quot;Child-Prozess&quot;???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285557</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 15 May 2007 16:19:03 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 16:57:36 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Was verstehst Du unter &quot;Child-Prozess&quot;???</p>
</blockquote>
<p>Ah, OK:<br />
Wenn ich den Code als eigene Methode in meinem Programm benutze, wie angezeigt, dann wird der neue Prozess als 'Kind' des meines Programms gestartet.<br />
Da ich Programme starten möchte, die auch ins Internet gehen, zeigt eine Firewall mein Programm als Internet-suchend an und nicht das gestartete (zumindest meine).</p>
<p>Man kann den Prozess wohl auch mit Userangaben oder ähnlichem starten oder an den Parent weitergeben, damit wäre mein Prg. dann 'auf dem Schneider'.</p>
<p>Mein Problem wird vielleicht klarer, wenn man bsw. Sysinternals ProcessExplorer benutzt, der zeigt an, wer wen gestartet hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285596</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 15 May 2007 16:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Tue, 15 May 2007 17:06:16 GMT]]></title><description><![CDATA[<p>Habs nicht probiert: CREATE_NEW_PROCESS_GROUP</p>
<p>Aber: Warum zeigt die Firewall *Dein* Programm an? Das verstehe ich nicht so ganz... Du willst Doch nicht ins internet, sondern das gestartete Programm, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285605</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 15 May 2007 17:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to Noch einmal CreateProcess - NICHT als Child?! on Mon, 21 May 2007 07:13:54 GMT]]></title><description><![CDATA[<p>Das probiere ich morgen mal.<br />
K.A. warum, tut sie aber. Ist wohl so plietsch und sucht sich den eigentlichen Auslöser. Hab mal was von Attacken über gelesen, bei denen der Schädling auch über den IE nach draussen telefonierte. Vielleicht wegen solcher Sachen.</p>
<p>---</p>
<p>Edit: Ich habe jetzt nach einigem Überlegen, die Vermutung, dass das</p>
<pre><code>WaitForSingleObject
</code></pre>
<p>mit</p>
<pre><code>INFINITE
</code></pre>
<p>dazu führt, daß die Handles erst nach Beendigung des neuen Prozesses gelöscht werden (da bin ich sicher) und dass erst nach dem Löschen der Prozess 'eigenständig' und unter eigenem Namen läuft. Mal sehen....</p>
<p>-----</p>
<p>So, das Ganze hat mit INFINITE nicht sehr viel zu tun. Die nVidia-Firwall (bzw. der NAM) scheint etwas anders zu arbeiten, als andere Desktop-Firewalls. Er zeigt oftmals einen Elternprozess als denjenigen an, der ins INet will.<br />
Das hat also anscheinend nichts mit meinem Programm zu tun.<br />
thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1285676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1285676</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 21 May 2007 07:13:54 GMT</pubDate></item></channel></rss>