<?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[Hook + SendMessage Problem]]></title><description><![CDATA[<p>Ich schicke mir in meiner Tastatur Hook Dll immer eine Nachricht ans Hauptprogramm wenn eine Taste gedrück wird.<br />
Das funktioniert wunderbar, aber nur wenn mein Programm auch den Fokus hat. Warum geht das nicht wenn es im Hintergrund ist? Wieso kommt die Message nicht an? Gesendet wird die vomn Dll...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/127046/hook-sendmessage-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 15:04:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127046.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Nov 2005 21:36:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hook + SendMessage Problem on Sun, 20 Nov 2005 21:36:38 GMT]]></title><description><![CDATA[<p>Ich schicke mir in meiner Tastatur Hook Dll immer eine Nachricht ans Hauptprogramm wenn eine Taste gedrück wird.<br />
Das funktioniert wunderbar, aber nur wenn mein Programm auch den Fokus hat. Warum geht das nicht wenn es im Hintergrund ist? Wieso kommt die Message nicht an? Gesendet wird die vomn Dll...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/922742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922742</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Sun, 20 Nov 2005 21:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 06:49:17 GMT]]></title><description><![CDATA[<p>Weil es nicht so ohne weiteres geht eine Msg von einem Prozess zu einem anderen zu schicken... Du must irgend eine Art &quot;Inter-Process-Communication&quot; machen!<br />
Siehe: <a href="http://msdn.microsoft.com/library/en-us/ipc/base/interprocess_communications.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/ipc/base/interprocess_communications.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/922949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922949</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 21 Nov 2005 06:49:17 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 07:25:41 GMT]]></title><description><![CDATA[<p>Ok, das kling sehr interessant... Vielen Dank! Ich könnte also alles durch ne Pipe schieben und in einem zweiten Thread in meinem Hauptprogramm imm fleißig daraus lesen. Von dort könnte ich doch problemlos Nachrichten schicken, oder? Innerhalb des gleichen Programms?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/922977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922977</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Mon, 21 Nov 2005 07:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 07:27:49 GMT]]></title><description><![CDATA[<p>Ja.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/922981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/922981</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 21 Nov 2005 07:27:49 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 13:43:14 GMT]]></title><description><![CDATA[<p>Aber es muss auch ohne Pipe gehen. Warum bekomme ich denn im minimierten Zustand keine Messages zugestellt?<br />
Ein Timer kriegt doch auch seine Messages(Ok, die schickt mir das System) und auch sonst ist man doch minimiert nicht hinterm Mond...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/923288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923288</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Mon, 21 Nov 2005 13:43:14 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 13:56:09 GMT]]></title><description><![CDATA[<p>PS: Könnte ich nicht vom Dll WM_COPYDATA an mein Hauptprogramm schicken? In COPYDATASTRUCT wäre ja Platz für meine Daten.<br />
Steht in der msdn als &quot;Using Data Copy for IPC&quot; Routine!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/923306</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923306</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Mon, 21 Nov 2005 13:56:09 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 14:12:29 GMT]]></title><description><![CDATA[<p>Ja, das könntest Du.<br />
Du könntest auch mal auf Codeproject schauen, da gibt es ganz viele Beispiele für global Hooks!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/923328</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923328</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 21 Nov 2005 14:12:29 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Mon, 21 Nov 2005 21:32:01 GMT]]></title><description><![CDATA[<blockquote>
<p>Ja, das könntest Du.</p>
</blockquote>
<p>Nein, ich kann nicht. Es geht wieder nur wenn das Hauptprogramm fokusiert ist.<br />
Ehrlich gesagt: Warum sollte WM_COPYDATA zugestellt werden, wenn meine WM_USER + X nicht zugestellt wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/923876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923876</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Mon, 21 Nov 2005 21:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 07:24:34 GMT]]></title><description><![CDATA[<p>__gast schrieb:</p>
<blockquote>
<p>Warum sollte WM_COPYDATA zugestellt werden, wenn meine WM_USER + X nicht zugestellt wird?</p>
</blockquote>
<p>Weil einige Messages Prozess-Übergreifend geroutet werden und andere nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/923998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/923998</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 22 Nov 2005 07:24:34 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 16:57:47 GMT]]></title><description><![CDATA[<p>Dann ist WM_COPYDATA also keine Lösung für mich?<br />
Was sollte ich dann benutzen?<br />
Evtl gleich eine Pipe?<br />
Ich würde eigentlich gerne immer eine Message bekommen, wenn eine Taste gedrückt wird. Notfalls könnte ich da noch ein Workaround mit einem eigenen Thread machen... - vorrausgesezt ich kann mir aus einem Thread meines Programmes selbst Windows Messages schicken wenn ich gleichzeitig nicht den Fokus habe!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/924542</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924542</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Tue, 22 Nov 2005 16:57:47 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 17:04:28 GMT]]></title><description><![CDATA[<p>__gast schrieb:</p>
<blockquote>
<p>Dann ist WM_COPYDATA also keine Lösung für mich?</p>
</blockquote>
<p>Falls Du meinen ersten Link gelesen hättest, dann wüsstest Du das da steht:</p>
<blockquote>
<p>Using Data Copy for IPC<br />
Data copy enables an application to send information to another application using the WM_COPYDATA message.</p>
</blockquote>
<p>__gast schrieb:</p>
<blockquote>
<p>Was sollte ich dann benutzen?<br />
Evtl gleich eine Pipe?</p>
</blockquote>
<p>Hast Du Dir die Beispiele auf Codeproject angeschaut?`<br />
<a href="http://www.google.de/search?q=global+hook+site%3Acodeproject.com" rel="nofollow">http://www.google.de/search?q=global+hook+site%3Acodeproject.com</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/924548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924548</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 22 Nov 2005 17:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 17:11:57 GMT]]></title><description><![CDATA[<blockquote>
<blockquote>
<p>Using Data Copy for IPC<br />
Data copy enables an application to send information to another application using the WM_COPYDATA message.</p>
</blockquote>
</blockquote>
<p>Und wer sagt, dass das nicht funktioniert wenn mein Fenster minimiert ist?<br />
Oder würde es gehen, würde ich nicht aus meinem Dll senden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/924556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924556</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Tue, 22 Nov 2005 17:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 17:15:34 GMT]]></title><description><![CDATA[<p>was ist c# express?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/924558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924558</guid><dc:creator><![CDATA[Leon++]]></dc:creator><pubDate>Tue, 22 Nov 2005 17:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 17:23:26 GMT]]></title><description><![CDATA[<p>Das ist die kostenlose Entwicklungsumgebung für das neue C#2.0 von Microsoft: <a href="http://msdn.microsoft.com/vstudio/express/visualcsharp/" rel="nofollow">http://msdn.microsoft.com/vstudio/express/visualcsharp/</a><br />
Und das ganze Ding ist wirklich genial! UI-Programme mache ich jetzt nur noch in C#.</p>
<p>Eine Ausführliche Erläuterung findes Du hier:<br />
<a href="http://www.dotnetframework.de/glossar/components/3098/C%20Express%20Edition.aspx" rel="nofollow">http://www.dotnetframework.de/glossar/components/3098/C%20Express%20Edition.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/924567</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924567</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 22 Nov 2005 17:23:26 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 17:36:03 GMT]]></title><description><![CDATA[<p>Titel des Postings schrieb:</p>
<blockquote>
<p>Hook + SendMessage Problem</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/924575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924575</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Tue, 22 Nov 2005 17:36:03 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 20:09:31 GMT]]></title><description><![CDATA[<p>Also? Sollte ich es gleich mit der Pipe probieren? Und wenn ja, geht es dann auch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/924692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924692</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Tue, 22 Nov 2005 20:09:31 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Tue, 22 Nov 2005 21:46:06 GMT]]></title><description><![CDATA[<p>Ich empfehle Dir: <a href="http://www.google.de/search?q=global+hooks+c%2B%2B" rel="nofollow">Schau Dir mal die diversen Beispiele an!</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/924772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/924772</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 22 Nov 2005 21:46:06 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 18:02:42 GMT]]></title><description><![CDATA[<p>Das Board schrieb:</p>
<blockquote>
<p>Beiträge insgesamt: 373<br />
[0.05% aller Beiträge / 31.08 Beiträge pro Tag]<br />
Alle Beiträge von Jochen Kalmbach anzeigen</p>
</blockquote>
<p>Es mag ja sein, dass deine Beiträge von unglaublichem Fachwissen strotzen, aber ich muss trotzdem sagen: Deine Antworten helfen mir kaum weiter!<br />
Wenn ich hier zu einem konkreten Problem eine Frage stelle, bringt es mir nichts, wenn du mir Links zu google mit sehr allgemein formulierten Suchbegriffen zum Thema Hooks schickst!</p>
<blockquote>
<p>Ich empfehle Dir: Schau Dir mal die diversen Beispiele an!</p>
</blockquote>
<blockquote>
<p>msdn [Allgemeiner Artikel zu Hooks]<br />
Global System Hooks in .NET [.Net &amp; co]<br />
Processing Global Mouse and Keyboard Hooks in C# [C#]<br />
·.NET Global Hook [Wieder .Net]<br />
An introduction to hook procedures [Nett, aber eher für Anfänger und total allgemein.]<br />
Managed Kod ile Global Hook ; [Eine Sprache der ich nicht mächtig bin]<br />
SP Scripting Language Documentation [Ganz daneben]<br />
c++ - System hooks &amp; DLL shared segments [shared segments - ok - ist aber nich was ich suche]<br />
HOOK GLOBAL (SYSTEM-WIDE HOOK) - BLOCAGE DE TOUCHES Code source ... [auch nicht...]<br />
Spying on .NET Applications [nochmal nicht...]<br />
usw...</p>
</blockquote>
<p>Ich habe ja nix gegen google Links, aber wenn ich hier Frage habe ich schon gegoogelt und außerdem: WAS willst du mir damit sagen?</p>
<p>Da du dich ja offensichtlich mit der Materie auskennst, warum schreibst du nur &quot;ja&quot;, &quot;nein&quot; oder guck &quot;hier&quot;(wobei &quot;hier&quot; nicht weiterhilft)?</p>
<p>Vielleicht formuliere ich einfach meine Frage nochmal präzise, lag vielleicht ja auch nur an mir:<br />
Ich habe einen Tastatur Hook in einer Dll und möchte in meinem Hauptprogramm zu jeder Zeit mit einer Message benachrichtigt werden wenn eine Taste gedrückt wird!</p>
<p>Getestet habe ich ja nun schon WM_COPYDATA, das funktioniert nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925538</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Wed, 23 Nov 2005 18:02:42 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 18:20:25 GMT]]></title><description><![CDATA[<p>Hast Du mal ein Beispiel bei codeproject (auf die ich schon zweimal hingewiesen habe) angeschaut?<br />
Ein globaler Hook ist nun mal nicht trivial und somit nicht einfach zu implementieren! Du musst Dir schon auch selber etwas mühe machen...</p>
<p>Aber zurück zur eigentlichen Frage:<br />
Aus meiner Sicht sollte WM_COPYDATA funktionieren. Woher hast Du denn in der DLL das Fenster-Handle an den Du die Msg schickst?<br />
Hast Du ein Bereich in Deiner DLL als .shared markiert wo Du das handle den anderen Prozessen mitteilen kannst?<br />
Oder wie kommt das Fenster-Handle von Deinem Hauptprozess (der wo ja die Msg empfangen soll) zu all den anderen Prozesses (bzw. Deinen vielen (Data-)Instanzen Deiner DLL in allen anderen Prozessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925556</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 23 Nov 2005 18:20:25 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 18:39:12 GMT]]></title><description><![CDATA[<p>handle wird in</p>
<pre><code class="language-cpp">EXPORT BOOL CALLBACK SetupHook (HWND hParent)
</code></pre>
<p>übergeben und in</p>
<pre><code class="language-cpp">#pragma data_seg (&quot;Shared&quot;)
HWND hWindow = 0 ;
#pragma data_seg ()
</code></pre>
<p>gespeichert!</p>
<p>Der Codeproject Artikel funktioniert bei mir noch nicht. Ist teilweise etwas sehr MSCompiler-nah. Mein BCB kommt damit überhaupt nicht klar...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925576</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Wed, 23 Nov 2005 18:39:12 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 18:39:56 GMT]]></title><description><![CDATA[<p>PS: Die Nachrichten kommen ja auch an wenn das Fenster fokusiert ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925577</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Wed, 23 Nov 2005 18:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 19:05:19 GMT]]></title><description><![CDATA[<p>__gast schrieb:</p>
<blockquote>
<p>#pragma data_seg (&quot;Shared&quot;)</p>
</blockquote>
<p>Das sollte heissen:</p>
<pre><code class="language-cpp">#pragma data_seg(&quot;.SHARED&quot;)
HWND hWindow = 0;
#pragma data_seg()
#pragma comment(linker, &quot;/section:.SHARED,RWS&quot;)
</code></pre>
<p>Sonst wird ja nix geshared!</p>
<p>__gast schrieb:</p>
<blockquote>
<p>Die Nachrichten kommen ja auch an wenn das Fenster fokusiert ist!</p>
</blockquote>
<p>Das ist ja auch logisch... da bist Du ja im selben Prozess und die DLL hat den richtigen Wert! Bei den anderen Prozesses ist der Wert aber auf 0, da er nicht geshared wurde...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925597</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925597</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 23 Nov 2005 19:05:19 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 19:08:15 GMT]]></title><description><![CDATA[<pre><code>[C++ Warning] hookdll.cpp(28): W8094 Incorrect use of #pragma comment( &lt;type&gt; [,&quot;string&quot;] )
</code></pre>
<p>die Sache mit dem RWS schluckt er einfach nicht...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925600</guid><dc:creator><![CDATA[__gast]]></dc:creator><pubDate>Wed, 23 Nov 2005 19:08:15 GMT</pubDate></item><item><title><![CDATA[Reply to Hook + SendMessage Problem on Wed, 23 Nov 2005 19:12:15 GMT]]></title><description><![CDATA[<p>Das ist halt MS VC... wie das bei Dir geht weis ist nicht... Du must auf jedem Fall dem Linker mitteilen, dass er dieses DataSegment sharen soll!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925603</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 23 Nov 2005 19:12:15 GMT</pubDate></item></channel></rss>