<?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[Überprüfung ob eine Anwendung geöffnet ist]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie man ein Programm startet und beendet weiß ich, doch wie überprüft man ob ein Programm bereits läuft?<br />
Danke im voraus,</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173739/überprüfung-ob-eine-anwendung-geöffnet-ist</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 15:53:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173739.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Feb 2007 13:13:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 13:13:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie man ein Programm startet und beendet weiß ich, doch wie überprüft man ob ein Programm bereits läuft?<br />
Danke im voraus,</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231169</guid><dc:creator><![CDATA[martinw]]></dc:creator><pubDate>Mon, 19 Feb 2007 13:13:23 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 13:15:05 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-12225.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-12225.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231173</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231173</guid><dc:creator><![CDATA[rean]]></dc:creator><pubDate>Mon, 19 Feb 2007 13:15:05 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 13:17:28 GMT]]></title><description><![CDATA[<p><em>FindWindow(const char * ClassName, const char * WindowName)</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231178</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 19 Feb 2007 13:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 13:25:16 GMT]]></title><description><![CDATA[<p>[EDIT] zu langsam, aber trotzdem lesenswert wenn die anwedung kein sichtbares formular hat z.B. durch Application-&gt;ShowMainForm = false; [/EDIT]</p>
<p>also laut hilfe</p>
<pre><code>int WinMain(          HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
);
Parameters

hInstance
[in] Handle to the current instance of the application. 
hPrevInstance
[in] Handle to the previous instance of the application. 
This parameter is always NULL. 
If you need to detect whether another instance already exists, 
create a uniquely named mutex using the CreateMutex function. 
CreateMutex will succeed even if the mutex already exists, 
but the function will return ERROR_ALREADY_EXISTS. 
This indicates that another instance of your application exists, 
because it created the mutex first.
</code></pre>
<p>mein vorschlag wäre es in der beziehung in deine cpp datei deines projekts (nicht die MAIN) ein</p>
<pre><code>HANDLE CreateMutex(
  LPSECURITY_ATTRIBUTES lpMutexAttributes,
  BOOL bInitialOwner,
  LPCTSTR lpName
);
</code></pre>
<p>mit lpName = Anwedungsname zu wählen und im falle von ERROR_ALREADY_EXISTS die startende anwendung noch vor dem Application-&gt;FormCreate() abzuwürgen.</p>
<p>das ist nur eine idee von mir, hab es selber nicht probiert, hab aber ein ähnliches problem, das ich noch ganz anders gelöst habe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231182</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Mon, 19 Feb 2007 13:25:16 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 14:00:23 GMT]]></title><description><![CDATA[<p>Wenn ich das richtig verstanden habe geht es ihm aber nicht nur um seine eigenen Programme sondern vor allem um welche die er nicht programmiert hat.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231221</guid><dc:creator><![CDATA[rean]]></dc:creator><pubDate>Mon, 19 Feb 2007 14:00:23 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 14:07:13 GMT]]></title><description><![CDATA[<blockquote>
<p>wie man <strong>ein Programm</strong> startet und beendet weiß ich, doch wie überprüft man ob <strong>ein Programm</strong> bereits läuft?</p>
</blockquote>
<p>im kontext der wiederholten verwendung von &quot;ein Programm&quot; kann man das aber auch anders sehen<br />
einigen wir uns auf eine missverständliche Frage ^^ und hoffen auf aufklärung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231231</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Mon, 19 Feb 2007 14:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 14:07:41 GMT]]></title><description><![CDATA[<p>Hab ich auch so verstanden ... auf welchen Post spielst du denn jetzt an?</p>
<p>FindWindow kann doch auch für &quot;externe&quot; Anwendungen genutzt werden.<br />
Zum Beispiel um die Taskleiste anzusprechen...</p>
<pre><code class="language-cpp">ShowWindow(FindWindow(&quot;SHELL_TRAYWND&quot;, NULL), SW_HIDE); //müsste extern genug sein
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1231233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231233</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 19 Feb 2007 14:07:41 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 15:01:22 GMT]]></title><description><![CDATA[<p>trotzdem gehst du dabei von einem existierenden formular aus!!!<br />
was wenn die applikation aber kein formular hat ?</p>
<p>da wir uns hier bei borland vcl aufhalten entfällt diese frage eigentlich fast aber dennoch!!!<br />
ausserdem kann es doch gut sein das die anwendung hängt oder was weis ich noch alles zwischen dem WinMain und dem Application.CreateForm() liegen schon ein paar Zeilen.</p>
<p>Ausserdem hab ich das aus der Hilfe gezogen, und die hat mir bisher immer recht brauchbare erfolge beschert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231287</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Mon, 19 Feb 2007 15:01:22 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Mon, 19 Feb 2007 15:12:18 GMT]]></title><description><![CDATA[<p>Dann frag ich ab, ob die Anwendung sichtbar oder unsichtbar is... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<pre><code class="language-cpp">HWND hWnd = FindWindow(&quot;SHELL_TRAYWND&quot;, NULL)
if (IsWindowVisible(hWnd))
    ShowMessage(&quot;sichtbar&quot;);
//...
</code></pre>
<p>Edit: Zugegeben, dass funktioniert nur wenn du den exakten Fenstertitel kennst, aber davon geh ich aus, wenn er eine bestimmte Anwendung auf &quot;Existenz&quot; überprüfen will :EditEnde</p>
<p>Ja nee wie auch immer ... er wird schon wissen was er will und sich auch dementsprechend verhalten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
<p>mfg, Micha!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231292</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 19 Feb 2007 15:12:18 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Wed, 21 Feb 2007 13:33:37 GMT]]></title><description><![CDATA[<p>Wenn man das Programm mit ShellExecuteEx startet, bekommt man ein Prozesshandle mit zurück, welches man auch zu Schließen des Programmes nutzen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1231305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1231305</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 21 Feb 2007 13:33:37 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Wed, 21 Feb 2007 03:39:35 GMT]]></title><description><![CDATA[<p>rean schrieb:</p>
<blockquote>
<p>Wenn ich das richtig verstanden habe geht es ihm aber nicht nur um seine eigenen Programme sondern vor allem um welche die er nicht programmiert hat.</p>
</blockquote>
<p>Richtig ! Ich will von meinem Programm aus überprüfen ob ein externes Programm, dessen Name mir bekannt ist, ausgeführt wird.</p>
<p>Hab mit diesem Vorschlag von RandomAccess85 mein Problem gerade gelöst:</p>
<p>HWND hWnd = FindWindow(&quot;SHELL_TRAYWND&quot;, NULL)<br />
if (IsWindowVisible(hWnd))<br />
ShowMessage(&quot;sichtbar&quot;);<br />
//...</p>
<p>danke an alle für die hilfsbereitschaft ( trotz meiner schlechten Fehlerbeschreibung <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> ..was nicht mehr vorkommt ;)) !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1232356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1232356</guid><dc:creator><![CDATA[martinw]]></dc:creator><pubDate>Wed, 21 Feb 2007 03:39:35 GMT</pubDate></item><item><title><![CDATA[Reply to Überprüfung ob eine Anwendung geöffnet ist on Wed, 21 Feb 2007 09:25:30 GMT]]></title><description><![CDATA[<p>trotzdem möchte ich zum thema singleton instance was hinterherwerfen, habs grad selber implementiert, funktioniert ganz gut und es zu wissen schadet auch nicht:</p>
<pre><code class="language-cpp">WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    HANDLE Mutex = CreateMutex(NULL, false, &quot;MyAppInstance&quot;);
    if (GetLastError() == ERROR_ALREADY_EXISTS) return 0;

    // try-catch der WinMain mit Application-&gt;Run(); usw.

    CloseHandle(Mutex); // falls ein anderer prozess als der benutzer das programm startet muss der mutex wieder freigegeben werden
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1232438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1232438</guid><dc:creator><![CDATA[Ceos]]></dc:creator><pubDate>Wed, 21 Feb 2007 09:25:30 GMT</pubDate></item></channel></rss>