<?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[CreateMutex]]></title><description><![CDATA[<p>Hallo Forum</p>
<p>Um ein Doppelstart meiner Anwendung zu vermeiden verwende ich folgendes:</p>
<pre><code class="language-cpp">HANDLE hMutex;
	hMutex = ::CreateMutex(NULL, FALSE, &quot;MeinProgName&quot;);
	if( GetLastError() == ERROR_ALREADY_EXISTS )
	{
		MessageBox(NULL,&quot;Dieses Programm ist schon geöffnet!&quot;, &quot;Fehler: Programm existiert schon&quot;, MB_OK | MB_ICONWARNING);
		CloseHandle(hMutex);
		PostQuitMessage(0);
		return FALSE;
	}
</code></pre>
<p>Dieser Code steht im C*App::InitInstance() und es ist ein SDI-Prog.</p>
<p>Das funzt ja auch.<br />
Ich möchte nun das erstaufgerufene Prog aktivieren, weis leider nicht wie?</p>
<p>Danke im voraus.</p>
<p>mfg Jo..</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/154835/createmutex</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Jul 2026 00:20:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/154835.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 31 Jul 2006 10:20:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateMutex on Mon, 31 Jul 2006 10:20:05 GMT]]></title><description><![CDATA[<p>Hallo Forum</p>
<p>Um ein Doppelstart meiner Anwendung zu vermeiden verwende ich folgendes:</p>
<pre><code class="language-cpp">HANDLE hMutex;
	hMutex = ::CreateMutex(NULL, FALSE, &quot;MeinProgName&quot;);
	if( GetLastError() == ERROR_ALREADY_EXISTS )
	{
		MessageBox(NULL,&quot;Dieses Programm ist schon geöffnet!&quot;, &quot;Fehler: Programm existiert schon&quot;, MB_OK | MB_ICONWARNING);
		CloseHandle(hMutex);
		PostQuitMessage(0);
		return FALSE;
	}
</code></pre>
<p>Dieser Code steht im C*App::InitInstance() und es ist ein SDI-Prog.</p>
<p>Das funzt ja auch.<br />
Ich möchte nun das erstaufgerufene Prog aktivieren, weis leider nicht wie?</p>
<p>Danke im voraus.</p>
<p>mfg Jo..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107613</guid><dc:creator><![CDATA[Jo..]]></dc:creator><pubDate>Mon, 31 Jul 2006 10:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to CreateMutex on Mon, 31 Jul 2006 12:32:34 GMT]]></title><description><![CDATA[<p>Hat keiner ne Ahnung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107737</guid><dc:creator><![CDATA[Jo..]]></dc:creator><pubDate>Mon, 31 Jul 2006 12:32:34 GMT</pubDate></item><item><title><![CDATA[Reply to CreateMutex on Sun, 06 Aug 2006 15:26:53 GMT]]></title><description><![CDATA[<p>Folgende Idee: (in <strong>Fett</strong> stehen Sachen / Funkrionsnamben wo ich nicht weiß ob sie funkrionieren</p>
<p><strong>1(a). Im Mutex das Handle zur Instanz (Type <em>hInstance</em>) abspeichern</strong></p>
<p>**1(b). Mit einer Funktion die Instanz vom Mutex ableiten z.B.</p>
<pre><code>HINSTANCE GetInstanceFromMutex( ... )
</code></pre>
<p>**</p>
<p>**2. Eine funktion aufrufen, ide das Fenster ermittelt:</p>
<pre><code class="language-cpp">Wahrscheinlich:
GetMainWindo( ... ) // Oder so ähnlich
```**   

3\. Eine *SendMessage* \- Funktion aufrufen um das Hauftfenster eine Nachricht zu hinterlassen  

4\. IM Hauptfenster die Nachricht abfangen und auswerten  

P.S. WEnn es möglich ist, könnt ihr meinen Textz ändern und den &quot;Ideen&quot; (Funtions-) &quot;Namen&quot; geben</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1111642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1111642</guid><dc:creator><![CDATA[denniS++]]></dc:creator><pubDate>Sun, 06 Aug 2006 15:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to CreateMutex on Sun, 06 Aug 2006 18:36:47 GMT]]></title><description><![CDATA[<p>An MFC class to implement single instance apps<br />
<a href="http://www.naughter.com/sinstance.html" rel="nofollow">http://www.naughter.com/sinstance.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1111776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1111776</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 06 Aug 2006 18:36:47 GMT</pubDate></item></channel></rss>