<?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[Programm in vordergrund holen]]></title><description><![CDATA[<p>hallo community</p>
<p>ich habe ein simples programm geschrieben<br />
es ist einfach ein popup, der dem nutzer eine info übergibt</p>
<p>nun soll dieses fenster aber nicht mehrmals erscheinen, sondern nur einmal<br />
wenn der nutzer nochmal einen aufruf des popups verursacht, dann soll die bereits geöffnete instanz in den vordergrund geholt werden</p>
<p>aber wie kann ich das bewerkstelligen</p>
<p>ich hab es mit findwindow probiert aber der popup wird damit wohl nicht erkannt, zumidnest funktioniert es so nicht<br />
hier der quelltext bisher:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
{
	char *psMutexName = &quot;UBnomail&quot;;
    char *text = &quot;Mailversand ist über diesen Computer nicht möglich!\r\nBitte nutzen sie ihr eigenes Mailkonto (z.B. GMX, web.de)&quot;;
    char *titel = &quot;Information&quot;;

	CreateMutex(NULL, true, psMutexName);
	if(GetLastError() == ERROR_ALREADY_EXISTS)
	{
		HWND hWndFirst = FindWindow(titel, NULL); 
        BringWindowToTop(hWndFirst); 
        SetForegroundWindow(hWndFirst);
		return -1;
	}
    MessageBox(NULL, text, titel, MB_OK | MB_ICONWARNING);
    return 0;
}
</code></pre>
<p>mfg<br />
Michael Richter</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/89517/programm-in-vordergrund-holen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 15:25:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/89517.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Oct 2004 12:26:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm in vordergrund holen on Wed, 20 Oct 2004 12:26:27 GMT]]></title><description><![CDATA[<p>hallo community</p>
<p>ich habe ein simples programm geschrieben<br />
es ist einfach ein popup, der dem nutzer eine info übergibt</p>
<p>nun soll dieses fenster aber nicht mehrmals erscheinen, sondern nur einmal<br />
wenn der nutzer nochmal einen aufruf des popups verursacht, dann soll die bereits geöffnete instanz in den vordergrund geholt werden</p>
<p>aber wie kann ich das bewerkstelligen</p>
<p>ich hab es mit findwindow probiert aber der popup wird damit wohl nicht erkannt, zumidnest funktioniert es so nicht<br />
hier der quelltext bisher:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
{
	char *psMutexName = &quot;UBnomail&quot;;
    char *text = &quot;Mailversand ist über diesen Computer nicht möglich!\r\nBitte nutzen sie ihr eigenes Mailkonto (z.B. GMX, web.de)&quot;;
    char *titel = &quot;Information&quot;;

	CreateMutex(NULL, true, psMutexName);
	if(GetLastError() == ERROR_ALREADY_EXISTS)
	{
		HWND hWndFirst = FindWindow(titel, NULL); 
        BringWindowToTop(hWndFirst); 
        SetForegroundWindow(hWndFirst);
		return -1;
	}
    MessageBox(NULL, text, titel, MB_OK | MB_ICONWARNING);
    return 0;
}
</code></pre>
<p>mfg<br />
Michael Richter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633289</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Wed, 20 Oct 2004 12:26:27 GMT</pubDate></item><item><title><![CDATA[Reply to Programm in vordergrund holen on Wed, 20 Oct 2004 12:55:34 GMT]]></title><description><![CDATA[<p>FindWindow kann das Fenster nicht finden, weil (zumindest in dem Code oben) die Parameter falschrum übergeben werden.</p>
<p>Richtig wäre: Erst NULL, dann Titel</p>
<pre><code class="language-cpp">HWND hWndFirst = FindWindow(NULL, titel);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/633312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633312</guid><dc:creator><![CDATA[the_alien]]></dc:creator><pubDate>Wed, 20 Oct 2004 12:55:34 GMT</pubDate></item><item><title><![CDATA[Reply to Programm in vordergrund holen on Wed, 20 Oct 2004 17:48:39 GMT]]></title><description><![CDATA[<p>*handandenkopfklatsch*</p>
<p>das wars<br />
dank dir</p>
]]></description><link>https://www.c-plusplus.net/forum/post/633598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/633598</guid><dc:creator><![CDATA[poncho]]></dc:creator><pubDate>Wed, 20 Oct 2004 17:48:39 GMT</pubDate></item></channel></rss>