<?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[Handle ermitteln]]></title><description><![CDATA[<p>Hi @all</p>
<p>ich weiss, dass es hier im Forum und bei Google bereits Beispiele für mein Problem gibt, denoch konnte ich es bisher nicht lösen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Ich starte eine fremde exe auf meinem Code, bring dann mein eigenes Fenster auf den Bildschrim und stell dort ein paar Infos dar (einfach ein wenig Text). Danach sollte ich jedoch das &quot;fremde&quot; Programm in den Vordergurnd bringen. Das Problem das ich jetzt habe: <em>Wie krige ich den Handle von dem Prog?</em> Der Text der links oben im Fensterrahmen dargestellt wird ist immer der selbe: &quot;Info - DLG&quot;. Ich habe es mit dem folgenden Code versucht, ohne Erfolg, das fremde Fenster bleibt im Hintergrund.</p>
<pre><code class="language-cpp">ShellExecute(0,&quot;open&quot;,&quot;C:\\Programme\\my Progs\\DummyFolder\\Start.exe&quot;,&quot;/quiet&quot;,0,SW_SHOW );

// Hier wird mein eigenes Fenster dargestellt und die Infos ausgegeben
// ...
// ...

// Das fremde Prog wieder in den Vordergrund schieben:
hWindow = FindWindowEx(FindWindow(0,&quot;Info - DLG&quot;), 0, 0, 0);

if(!hWindow)
MessageBox(0,&quot;Fenster nicht gefunden&quot;,0,0);
else
SetForegroundWindow(hWindow);
</code></pre>
<p>Zu erwähnen ist, dass die Messagebox nicht auftaucht. D.h. hWindow ist ungleich Null!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146225/handle-ermitteln</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 06:32:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146225.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 May 2006 12:51:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 12:51:33 GMT]]></title><description><![CDATA[<p>Hi @all</p>
<p>ich weiss, dass es hier im Forum und bei Google bereits Beispiele für mein Problem gibt, denoch konnte ich es bisher nicht lösen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Ich starte eine fremde exe auf meinem Code, bring dann mein eigenes Fenster auf den Bildschrim und stell dort ein paar Infos dar (einfach ein wenig Text). Danach sollte ich jedoch das &quot;fremde&quot; Programm in den Vordergurnd bringen. Das Problem das ich jetzt habe: <em>Wie krige ich den Handle von dem Prog?</em> Der Text der links oben im Fensterrahmen dargestellt wird ist immer der selbe: &quot;Info - DLG&quot;. Ich habe es mit dem folgenden Code versucht, ohne Erfolg, das fremde Fenster bleibt im Hintergrund.</p>
<pre><code class="language-cpp">ShellExecute(0,&quot;open&quot;,&quot;C:\\Programme\\my Progs\\DummyFolder\\Start.exe&quot;,&quot;/quiet&quot;,0,SW_SHOW );

// Hier wird mein eigenes Fenster dargestellt und die Infos ausgegeben
// ...
// ...

// Das fremde Prog wieder in den Vordergrund schieben:
hWindow = FindWindowEx(FindWindow(0,&quot;Info - DLG&quot;), 0, 0, 0);

if(!hWindow)
MessageBox(0,&quot;Fenster nicht gefunden&quot;,0,0);
else
SetForegroundWindow(hWindow);
</code></pre>
<p>Zu erwähnen ist, dass die Messagebox nicht auftaucht. D.h. hWindow ist ungleich Null!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051517</guid><dc:creator><![CDATA[black_sheep_thomas]]></dc:creator><pubDate>Fri, 05 May 2006 12:51:33 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 14:09:55 GMT]]></title><description><![CDATA[<p>GetModuleHandle?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051590</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051590</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Fri, 05 May 2006 14:09:55 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 14:59:49 GMT]]></title><description><![CDATA[<p>Windows 98, Windows 2000: The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:</p>
<p>The process is the foreground process.<br />
The process was started by the foreground process.<br />
The process received the last input event.<br />
There is no foreground process.<br />
The foreground process is being debugged.<br />
The foreground is not locked (see LockSetForegroundWindow).<br />
The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).<br />
Windows 2000: No menus are active.<br />
With this change, an application cannot force a window to the foreground while the user is working with another window. Instead, SetForegroundWindow will activate the window (see SetActiveWindow) and call the FlashWindowEx function to notify the user.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051618</guid><dc:creator><![CDATA[mgs_]]></dc:creator><pubDate>Fri, 05 May 2006 14:59:49 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 18:49:23 GMT]]></title><description><![CDATA[<p>Warum FindWindowEx? Du willst doch das Handle von dem Dialog haben und nicht von einem Kindfenster. Ergo FindWindow benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051755</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051755</guid><dc:creator><![CDATA[Gast Luckie]]></dc:creator><pubDate>Fri, 05 May 2006 18:49:23 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 19:14:00 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/15778">@Gast</a> Luckie: Dein Vorschlag funktioniert bei mir nicht. Ich habe es mit einem Notpaddokument ausprobiert. Mit FindWindowEx() kann ich in das txt-File reinschreiben, mit FindWindow nicht...</p>
<p>@mgs_: Ich arbeite mit WinXP, SP2</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051761</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051761</guid><dc:creator><![CDATA[black_sheep_thomas]]></dc:creator><pubDate>Fri, 05 May 2006 19:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 19:19:46 GMT]]></title><description><![CDATA[<p>Die Regeln gelten auch für XP. Außer in den aufgeführten Fällen kannst Du mit SetForegroundWindow keine Fenster nach vorne holen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051764</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051764</guid><dc:creator><![CDATA[mgs_]]></dc:creator><pubDate>Fri, 05 May 2006 19:19:46 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 20:13:21 GMT]]></title><description><![CDATA[<p>1. Nimm SetWindowPos <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="😉"
    /><br />
2.</p>
<blockquote>
<p>Mit FindWindowEx() kann ich in das txt-File reinschreiben, mit FindWindow nicht...</p>
</blockquote>
<p>Normal sollte das (Rich-)Edit Feld ja auch ein Child des MainWnds sein -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051787</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 05 May 2006 20:13:21 GMT</pubDate></item><item><title><![CDATA[Reply to Handle ermitteln on Fri, 05 May 2006 21:49:26 GMT]]></title><description><![CDATA[<p>black_sheep_thomas schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/15778">@Gast</a> Luckie: Dein Vorschlag funktioniert bei mir nicht. Ich habe es mit einem Notpaddokument ausprobiert. Mit FindWindowEx() kann ich in das txt-File reinschreiben, mit FindWindow nicht...</p>
</blockquote>
<p>Logisch, das Memo ist ja auch ein Kind des Hauptfensters. Aber du willst ja ein Fenster in den Vordergund holen. Die Kindfenster dieses Fensters interessieren dich ja nicht. Oder habe ich da jetzt was falsch verstanden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051840</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051840</guid><dc:creator><![CDATA[Gast Luckie]]></dc:creator><pubDate>Fri, 05 May 2006 21:49:26 GMT</pubDate></item></channel></rss>