<?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[Anwendung schon geöffnet?]]></title><description><![CDATA[<p>Hallo.</p>
<p>Wie kann ich wenn meine Anwendung gestartet wurde, schauen, ob sie mehrmals geöffnet ist oder nur einmal?</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/68236/anwendung-schon-geöffnet</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 13:58:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/68236.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 16 Mar 2004 10:14:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Anwendung schon geöffnet? on Tue, 16 Mar 2004 10:14:09 GMT]]></title><description><![CDATA[<p>Hallo.</p>
<p>Wie kann ich wenn meine Anwendung gestartet wurde, schauen, ob sie mehrmals geöffnet ist oder nur einmal?</p>
<p>Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/481530</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/481530</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Tue, 16 Mar 2004 10:14:09 GMT</pubDate></item><item><title><![CDATA[Reply to Anwendung schon geöffnet? on Tue, 16 Mar 2004 10:42:03 GMT]]></title><description><![CDATA[<p>CreateMutex wäre eine lösung</p>
<pre><code class="language-cpp">int WINAPI WinMain(
    HINSTANCE hThisInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszArgument,
    int nCmdShow)
{
    // überprüfen ob programm schon gestartet ist
	CreateMutex(NULL, TRUE, &quot;Anwendung gestarted&quot;);
	if(GetLastError() == ERROR_ALREADY_EXISTS)
	{
		HWND        hWndFirst;
		hWndFirst = FindWindow(SZWNDCLASS, NULL);

		BringWindowToTop(hWndFirst);
		SetForegroundWindow(hWndFirst);

		return -1;
	}

// .....
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/481550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/481550</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 16 Mar 2004 10:42:03 GMT</pubDate></item><item><title><![CDATA[Reply to Anwendung schon geöffnet? on Tue, 16 Mar 2004 11:26:27 GMT]]></title><description><![CDATA[<p>Jo, das funzt, hast noch etwas vergessen, aber hier der ganze Code:</p>
<pre><code class="language-cpp">int WINAPI WinMain(
    HINSTANCE hThisInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszArgument,
    int nCmdShow)
{
    // überprüfen ob programm schon gestartet ist
	CreateMutex(NULL, TRUE, &quot;Anwendung gestartet&quot;);
	if(GetLastError() == ERROR_ALREADY_EXISTS)
	{
		HWND        hWndFirst;
		hWndFirst = FindWindow(&quot;TForm&quot;, NULL);

		BringWindowToTop(hWndFirst);
		SetForegroundWindow(hWndFirst);

		return -1;
	}
    ReleaseMutex(hWndFirst);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/481577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/481577</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Tue, 16 Mar 2004 11:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to Anwendung schon geöffnet? on Tue, 16 Mar 2004 11:49:32 GMT]]></title><description><![CDATA[<p>Windoof schrieb:</p>
<blockquote>
<p>Jo, das funzt, hast noch etwas vergessen, aber hier der ganze</p>
</blockquote>
<p>auch nicht ganz richtig <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">int WINAPI WinMain(
    HINSTANCE hThisInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpszArgument,
    int nCmdShow)
{
    // überprüfen ob programm schon gestartet ist
	HANDLE hMutex = CreateMutex(NULL, TRUE, &quot;Anwendung gestartet&quot;);
	if(GetLastError() == ERROR_ALREADY_EXISTS)
	{
		HWND        hWndFirst;
		hWndFirst = FindWindow(&quot;TForm&quot;, NULL);

		BringWindowToTop(hWndFirst);
		SetForegroundWindow(hWndFirst);

		return -1;
	}
// ......

    ReleaseMutex(hMutex);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/481595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/481595</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 16 Mar 2004 11:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to Anwendung schon geöffnet? on Tue, 16 Mar 2004 19:25:29 GMT]]></title><description><![CDATA[<p>Jo, stimmt... Hast ma wieder recht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Danke nochmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/482031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/482031</guid><dc:creator><![CDATA[Windoof]]></dc:creator><pubDate>Tue, 16 Mar 2004 19:25:29 GMT</pubDate></item></channel></rss>