<?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[Keyboardhook]]></title><description><![CDATA[<p>hey!<br />
also ich habe die FAQ zu Keyboardhooks gelesen.<br />
leider hat meine Anwendung kein Fenster aber die Daten werden über das hwnd übertragen:</p>
<pre><code class="language-cpp">SendMessage ((HWND) hWindow, (WM_USER + 2), (WPARAM) wParam, (LPARAM) lParam) ;
</code></pre>
<p>ich kann ja die Message nur empfangen wenn meine Anwendung ein Fenster hat oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/225474/keyboardhook</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 16:55:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/225474.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Oct 2008 19:54:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Keyboardhook on Thu, 23 Oct 2008 19:54:18 GMT]]></title><description><![CDATA[<p>hey!<br />
also ich habe die FAQ zu Keyboardhooks gelesen.<br />
leider hat meine Anwendung kein Fenster aber die Daten werden über das hwnd übertragen:</p>
<pre><code class="language-cpp">SendMessage ((HWND) hWindow, (WM_USER + 2), (WPARAM) wParam, (LPARAM) lParam) ;
</code></pre>
<p>ich kann ja die Message nur empfangen wenn meine Anwendung ein Fenster hat oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603625</guid><dc:creator><![CDATA[x3l33t]]></dc:creator><pubDate>Thu, 23 Oct 2008 19:54:18 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Thu, 23 Oct 2008 20:33:06 GMT]]></title><description><![CDATA[<p>jep.</p>
<p>Erzeuge doch ein leeres Fenster, was du direkt beim Erzeugen unsichtbar machst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603643</guid><dc:creator><![CDATA[vlad_tepesch]]></dc:creator><pubDate>Thu, 23 Oct 2008 20:33:06 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Thu, 23 Oct 2008 20:41:49 GMT]]></title><description><![CDATA[<p>das ist aber irgendwie unsauber gibt es da keinen besseren weg?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603647</guid><dc:creator><![CDATA[x3l33t]]></dc:creator><pubDate>Thu, 23 Oct 2008 20:41:49 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Thu, 23 Oct 2008 20:47:16 GMT]]></title><description><![CDATA[<p>nein</p>
<p>//Edit<br />
naja vllt doch, gemeinsam genutzter speicherbereich vllt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603652</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Thu, 23 Oct 2008 20:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 07:14:51 GMT]]></title><description><![CDATA[<p>x3l33t schrieb:</p>
<blockquote>
<p>das ist aber irgendwie unsauber gibt es da keinen besseren weg?</p>
</blockquote>
<p><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="😕"
    /> Wieso unsauber? <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="😕"
    /><br />
Bei allen anderen Methoden wirst Du extrem mehr Aufwand haben.</p>
<p>BTW: es geht auch ohn Fenster mit PostThreadMessage, aber man kommt ohne Nachrichtenschleife nicht aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1603998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1603998</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 24 Oct 2008 07:14:51 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 11:36:51 GMT]]></title><description><![CDATA[<p>wie mache ich das mit PostThreadMessage?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604128</guid><dc:creator><![CDATA[x3l33t]]></dc:creator><pubDate>Fri, 24 Oct 2008 11:36:51 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 11:45:41 GMT]]></title><description><![CDATA[<p>also wie man es anwendet weiß ich natürlich aber wie kann ich die Message im Hauptprogramm empfangen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604132</guid><dc:creator><![CDATA[x3l33t]]></dc:creator><pubDate>Fri, 24 Oct 2008 11:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 11:52:23 GMT]]></title><description><![CDATA[<p>x3l33t schrieb:</p>
<blockquote>
<p>wie mache ich das mit PostThreadMessage?</p>
</blockquote>
<p>Ähm *räusper*,<br />
bist Du Dir wirklich sicher, daß Du einen Keyboardhook benötigst?</p>
<p>Ich vermute, Du willst nur einfach und &quot;ganz normal&quot; für Dein Programm die Tastendrücke abfragen (also ohne diese Hooks)?<br />
(Die Vermutung deshalb, weil es mir den Anschein hat, daß Du nicht viel Grundlagenwissen über Nachrichten in Windows hast?)</p>
<p>Was genau macht eigentlich Dein Hauptprogramm ohne Nachrichtenschleife?</p>
<p>Das sieht mir nach einer dauer-residenten &quot;Böse&quot;-Software aus.<br />
Welche nicht auf normalem Wege beendet werden kann, denn dafür brauchst Du die Auswertung einer WM_QUIT-Nachricht!</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604135</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Fri, 24 Oct 2008 11:52:23 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 12:01:12 GMT]]></title><description><![CDATA[<p>x3l33t schrieb:</p>
<blockquote>
<p>wie mache ich das mit PostThreadMessage?</p>
</blockquote>
<p>Lesen kann nicht schaden oder?<br />
<a href="http://msdn.microsoft.com/en-us/library/ms644946(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms644946(VS.85).aspx</a></p>
<p>Im Detail:</p>
<blockquote>
<p>The thread to which the message is posted retrieves the message by calling the GetMessage or PeekMessage function. The hwnd member of the returned MSG structure is NULL.</p>
</blockquote>
<p>Bist Du Dir sicher, dass Du nicht über das Ziel hinausschießt?<br />
Wenn Du diese Frage schon stellst, dann ist ein Hook vermutlich jenseits Deiner Programmiererkapazität...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604141</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 24 Oct 2008 12:01:12 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 12:06:53 GMT]]></title><description><![CDATA[<p>kann ich die Post dann mit PeekMessage abfangen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604147</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604147</guid><dc:creator><![CDATA[berechtigtefrage]]></dc:creator><pubDate>Fri, 24 Oct 2008 12:06:53 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 12:30:49 GMT]]></title><description><![CDATA[<p>ok ihr habt recht ich mach es doch mit nem verstecktem Fenster:</p>
<pre><code class="language-cpp">// in WinMain
	HWND hwndDia = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, KeyboardDlg);
	SetupHook(hwndDia);

// der Dialog
BOOL CALLBACK KeyboardDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_INITDIALOG:
		 return TRUE;

	case WM_USER + 2:
		 if ((wParam&gt;='A' &amp;&amp; wParam&lt;='Z') || (wParam&gt;='0' &amp;&amp; wParam&lt;='9'))
		 {
		     char c = static_cast&lt;char&gt;(wParam);
			 MessageBox(0, (LPCSTR)c, (LPCSTR)c, 0);
		 }
		 return TRUE;
	}

	return FALSE;
}
</code></pre>
<p>warum bekomme ich keine MessageBox wenn ich ne taste drücke?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604159</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 12:30:49 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 12:35:03 GMT]]></title><description><![CDATA[<p>der Hook ist der aus der FAQ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604163</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604163</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 12:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 15:06:41 GMT]]></title><description><![CDATA[<p>Du kannst nicht einfach so einen char zu einem string casten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604249</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Fri, 24 Oct 2008 15:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 15:18:04 GMT]]></title><description><![CDATA[<p>das hat aber ichts damit zu tun WM_USER+2 wird nicht aufgerufen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604262</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 15:18:04 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 16:12:28 GMT]]></title><description><![CDATA[<p>einsichtig schrieb:</p>
<blockquote>
<p>warum bekomme ich keine MessageBox wenn ich ne taste drücke?</p>
</blockquote>
<p>einsichtig schrieb:</p>
<blockquote>
<p>das hat aber ichts damit zu tun WM_USER+2 wird nicht aufgerufen</p>
</blockquote>
<p>Wer schickt denn die Nachricht &quot;WM_USER+2&quot; ?<br />
Und wann wird sie gesendet?<br />
Und an welches Fenster?</p>
<p>Ohne diese Information funktioniert unsere Wahrsager-Kugel schlicht und einfach nicht um Deine Frage beantworten zu können <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Daher nochmal: Ich habe den Eindruck, daß:<br />
-die Grundlagen der Windows-Nachrichten (Messages) nicht verstanden worden sind und<br />
-ein Keyboard-Hook aufgrund der bisher hier festgestellten &quot;Mängel&quot; wahrscheinlich der völlig falsche Ansatz ist (in etwa so wie mit Kanonen auf Spatzen schießen)</p>
<p>Nimm eine Nachrichtenschleife und werte in den Proceduren die Nachrichten WM_KEYDOWN (oder WM_CHAR) aus.</p>
<p>Martin</p>
<p>P.S.: Daß ein Hook in einer FAQ steht, heißt noch lange nicht, daß Du ihn unbedingt einsetzen mußt...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604291</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Fri, 24 Oct 2008 16:12:28 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 16:18:36 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">char c = static_cast&lt;char&gt;(wParam);
			 MessageBox(0, (LPCSTR)c, (LPCSTR)c, 0);
</code></pre>
<p>lol.</p>
<p>Mmacher schrieb:</p>
<blockquote>
<p>Wer schickt denn die Nachricht &quot;WM_USER+2&quot; ?<br />
Und wann wird sie gesendet?<br />
Und an welches Fenster?</p>
<p>Ohne diese Information funktioniert unsere Wahrsager-Kugel schlicht und einfach nicht um Deine Frage beantworten zu können</p>
</blockquote>
<p>einsichtig schrieb:</p>
<blockquote>
<p>der Hook ist der aus der FAQ</p>
</blockquote>
<p>lol.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604293</guid><dc:creator><![CDATA[ascda]]></dc:creator><pubDate>Fri, 24 Oct 2008 16:18:36 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 16:23:16 GMT]]></title><description><![CDATA[<p>ohh wie toll supermeister ascda kann natürlich nur lollen und der andere ließt meinen Code nicht.</p>
<pre><code class="language-cpp">HWND hwndDia = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, KeyboardDlg);
    SetupHook(hwndDia);
</code></pre>
<p>ist doch eindeutig welches Fenster oder hwnd das ist oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604296</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 16:23:16 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 18:38:11 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">extern &quot;C&quot; __declspec (dllimport) BOOL CALLBACK SetupHook (HWND) ;
extern &quot;C&quot; __declspec (dllimport) BOOL CALLBACK UninstallHook (void) ;
</code></pre>
<p>so habe ich sie deklariert im Programm stimmt doch oder?<br />
Ist echt wichtig</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604355</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 18:38:11 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 18:58:28 GMT]]></title><description><![CDATA[<p>irgendwie hängt sich der Dialog auf.<br />
Wenn ich mit der Maus drüber gehe kommt die ganze zeit die Sanduuhr dann kackt es ab.<br />
Hier der Dialog Code:<br />
warum hängt sich der Dialog auf?</p>
<pre><code class="language-cpp">in Win main:
	HWND hwndDia = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), 0, KeyboardDlg);
	ShowWindow(hwndDia, TRUE);
	SetupHook(hwndDia);

das ist der Callback
BOOL CALLBACK KeyboardDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_INITDIALOG:
		 return TRUE;

	case (WM_USER + 2):
		 if ((wParam&gt;='A' &amp;&amp; wParam&lt;='Z') || (wParam&gt;='0' &amp;&amp; wParam&lt;='9'))
		 {
		     char c = static_cast&lt;char&gt;(wParam);
			 MessageBox(0, (LPCSTR)c, (LPCSTR)c, 0);
		 }
		 return TRUE;
	}

	return FALSE;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1604362</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604362</guid><dc:creator><![CDATA[einsichtig]]></dc:creator><pubDate>Fri, 24 Oct 2008 18:58:28 GMT</pubDate></item><item><title><![CDATA[Reply to Keyboardhook on Fri, 24 Oct 2008 19:48:55 GMT]]></title><description><![CDATA[<p>einsichtig schrieb:</p>
<blockquote>
<p>Wenn ich mit der Maus drüber gehe kommt die ganze zeit die Sanduuhr dann <strong>kackt</strong> es ab.</p>
</blockquote>
<p>Dürfen Nicht-Fäkal-Programmierer auch etwas zur Lösung beitragen?</p>
<p>Wenn ja, dann poste mal den Code (nicht Kot!) der WinMain!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1604384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1604384</guid><dc:creator><![CDATA[ausdruckzensor]]></dc:creator><pubDate>Fri, 24 Oct 2008 19:48:55 GMT</pubDate></item></channel></rss>