<?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[Messages eines anderen Programmes einsehen]]></title><description><![CDATA[<p>Hallo ich hab ein Problem bei dem ich Hilfe benötige:<br />
Ich möchte ein Programm (soll nur in der Kommandokonsole laufen) schreiben, das jedesmal wenn eine bestimmte Windows Anwendung den Fokus bekommt, eine Meldung ausgibt. Das Handle dieses Fenster, das überwacht werden soll ist bekannt. Wie kann ich das machen? Ich habs bisher auf diese Art probiert aber es passiert nichts:</p>
<pre><code>LRESULT CALLBACK WndProc(HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam)
{
        switch( message)
        {
              case WM_SETFOCUS:
                  cout &lt;&lt; &quot;Hallo&quot; &lt;&lt; '\n';
                  break;
              default:
                  return DefWindowProc(hWnd,message,wParam,lParam);         
        } 
        return 0;
}

int main(int argc, char *argv[])
{
    ...
    MSG msg;

    while(GetMessage(&amp;msg, fensterhwnd, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg); 
    }
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Mfg Felsen</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218331/messages-eines-anderen-programmes-einsehen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 09 Oct 2026 06:29:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218331.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Jul 2008 12:13:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Messages eines anderen Programmes einsehen on Sat, 19 Jul 2008 12:13:15 GMT]]></title><description><![CDATA[<p>Hallo ich hab ein Problem bei dem ich Hilfe benötige:<br />
Ich möchte ein Programm (soll nur in der Kommandokonsole laufen) schreiben, das jedesmal wenn eine bestimmte Windows Anwendung den Fokus bekommt, eine Meldung ausgibt. Das Handle dieses Fenster, das überwacht werden soll ist bekannt. Wie kann ich das machen? Ich habs bisher auf diese Art probiert aber es passiert nichts:</p>
<pre><code>LRESULT CALLBACK WndProc(HWND hWnd, unsigned int message, WPARAM wParam, LPARAM lParam)
{
        switch( message)
        {
              case WM_SETFOCUS:
                  cout &lt;&lt; &quot;Hallo&quot; &lt;&lt; '\n';
                  break;
              default:
                  return DefWindowProc(hWnd,message,wParam,lParam);         
        } 
        return 0;
}

int main(int argc, char *argv[])
{
    ...
    MSG msg;

    while(GetMessage(&amp;msg, fensterhwnd, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg); 
    }
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Mfg Felsen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1549746</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1549746</guid><dc:creator><![CDATA[Felsen]]></dc:creator><pubDate>Sat, 19 Jul 2008 12:13:15 GMT</pubDate></item><item><title><![CDATA[Reply to Messages eines anderen Programmes einsehen on Sat, 19 Jul 2008 12:21:31 GMT]]></title><description><![CDATA[<p>Du könntest einen Hook etablieren, such mal hier im Forum nach SetWindowsHookEx.</p>
<p>edit: WndProcs erhalten nur Nachrichten für das Fenster, für das sie registriert worden sind.</p>
<p>Eventuell klappt es auch, wenn du bei dem Fenster, das du überwachen willst, die originale WinProc holst (GetWindowLong(wnd,GWL_WNDPROC)), deine eigene reinschreibst (SetWindowLong(wnd,GWL_WNDPROC,...)) und für jede empfangene Nachricht CallWndProc(...) mit der Original-WndProc aufrufst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1549749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1549749</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 19 Jul 2008 12:21:31 GMT</pubDate></item><item><title><![CDATA[Reply to Messages eines anderen Programmes einsehen on Sat, 19 Jul 2008 12:47:58 GMT]]></title><description><![CDATA[<p>Gehört das nicht ins Win-API Forum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1549767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1549767</guid><dc:creator><![CDATA[Speedy_92]]></dc:creator><pubDate>Sat, 19 Jul 2008 12:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to Messages eines anderen Programmes einsehen on Sat, 19 Jul 2008 12:51:27 GMT]]></title><description><![CDATA[<p>Speedy_92 schrieb:</p>
<blockquote>
<p>Gehört das nicht ins Win-API Forum?</p>
</blockquote>
<p>Nein, Windows ist doch das Maß aller Dinge... <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="🙄"
    /></p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/26836">@Topic</a>: Geht das nicht auch mit Pipes?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1549769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1549769</guid><dc:creator><![CDATA[Eigendlich schon]]></dc:creator><pubDate>Sat, 19 Jul 2008 12:51:27 GMT</pubDate></item></channel></rss>