<?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 und mailto:]]></title><description><![CDATA[<p>Hi ihrs!</p>
<p>Ich habe ein kleines Problem mit CreateProcess. Ich möchte gerne das Standard-Mail-Programm des Systems starten und diesem Daten übergeben und solange warten, bis das Programm beendet ist (Also Outlook/Thunderbird/oä. beendet wurde.)</p>
<p>Hier mein Code.</p>
<pre><code class="language-cpp">platform::execute (&quot;mailto:mame@provider.com?subject=Testmail&quot;, true);

// [...]

bool platform::execute (const std::string&amp; file, bool wait)
{
    if (file.empty ())
        return (false);

#if defined (_WIN32)
    ::STARTUPINFO si = { sizeof(si) };
    ::PROCESS_INFORMATION  pi;

    if (!::CreateProcess (0, const_cast&lt;::LPSTR&gt;(file.c_str ()), 0, 0, false, 0, nullptr, 0, &amp;si, &amp;pi))
        return (false);

    if (wait)
        ::WaitForSingleObject (pi.hProcess, INFINITE);

    ::CloseHandle (pi.hProcess);
    ::CloseHandle (pi.hThread);
#else if defined (__linux__)
    // [...]
#endif
}
</code></pre>
<p>Leider schlägt CreateProcess fehl <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Jemand eine Idee was ich machen kann ohne ShellExecute zu benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/235110/createprocess-und-mailto</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 11:24:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/235110.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Feb 2009 19:11:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateProcess und mailto: on Wed, 25 Feb 2009 19:11:49 GMT]]></title><description><![CDATA[<p>Hi ihrs!</p>
<p>Ich habe ein kleines Problem mit CreateProcess. Ich möchte gerne das Standard-Mail-Programm des Systems starten und diesem Daten übergeben und solange warten, bis das Programm beendet ist (Also Outlook/Thunderbird/oä. beendet wurde.)</p>
<p>Hier mein Code.</p>
<pre><code class="language-cpp">platform::execute (&quot;mailto:mame@provider.com?subject=Testmail&quot;, true);

// [...]

bool platform::execute (const std::string&amp; file, bool wait)
{
    if (file.empty ())
        return (false);

#if defined (_WIN32)
    ::STARTUPINFO si = { sizeof(si) };
    ::PROCESS_INFORMATION  pi;

    if (!::CreateProcess (0, const_cast&lt;::LPSTR&gt;(file.c_str ()), 0, 0, false, 0, nullptr, 0, &amp;si, &amp;pi))
        return (false);

    if (wait)
        ::WaitForSingleObject (pi.hProcess, INFINITE);

    ::CloseHandle (pi.hProcess);
    ::CloseHandle (pi.hThread);
#else if defined (__linux__)
    // [...]
#endif
}
</code></pre>
<p>Leider schlägt CreateProcess fehl <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Jemand eine Idee was ich machen kann ohne ShellExecute zu benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1670288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1670288</guid><dc:creator><![CDATA[C++&#x27;ler]]></dc:creator><pubDate>Wed, 25 Feb 2009 19:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und mailto: on Wed, 25 Feb 2009 19:19:14 GMT]]></title><description><![CDATA[<p>Geht nur mit ShellExecuteEx. (Ex um auf das Beenden des Programms warten zu können)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1670296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1670296</guid><dc:creator><![CDATA[WinAPI&#x27;ler]]></dc:creator><pubDate>Wed, 25 Feb 2009 19:19:14 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und mailto: on Wed, 25 Feb 2009 19:42:30 GMT]]></title><description><![CDATA[<p>Schade, äußerst Schade, aber da muss ich dann wohl durch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1670318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1670318</guid><dc:creator><![CDATA[C++&#x27;ler]]></dc:creator><pubDate>Wed, 25 Feb 2009 19:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to CreateProcess und mailto: on Thu, 26 Feb 2009 17:06:31 GMT]]></title><description><![CDATA[<p>C++'ler schrieb:</p>
<blockquote>
<p>Schade, äußerst Schade, aber da muss ich dann wohl durch.</p>
</blockquote>
<p>Warum schade? IMHO ist ShellExecute(Ex) sowieso die bessere Wahl. ShellExecute behandelt wenigstens alle Programme so wie es auch der Explorer bzw. die Eingabeaufforderung macht.</p>
<p>Vor allem kann man eben auch Datendateien mit dem zugehörigen Programm öffnen oder andere Protokolle korrekt ausführen (siehe mailto...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1670815</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1670815</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 26 Feb 2009 17:06:31 GMT</pubDate></item></channel></rss>