<?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[keyhook legt sondertasten lahm]]></title><description><![CDATA[<p>hallo<br />
ich habe mir einen code zum auffangen von tastenanschlägen und mausklicks gebastelt. fängt soweit auch alles auf, nur funktionieren die sondertasten von meiner ms multimedia tastatur nicht mehr wenn der hook aktiv ist. hat hier jemand eine idee??</p>
<p>gruss peter h</p>
<p>mein code:</p>
<pre><code class="language-csharp">using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

public class UniversalHook : IDisposable
{
    //Variables used in the call to SetWindowsHookEx
    protected HookHandlerDelegate proc;
    protected IntPtr hookID = IntPtr.Zero;
    protected delegate IntPtr HookHandlerDelegate(int nCode, IntPtr wParam, ref IntPtr lParam);

    #region DllImports
    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr SetWindowsHookEx(int idHook, HookHandlerDelegate lpfn, IntPtr hMod, uint dwThreadId);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    protected static extern bool UnhookWindowsHookEx(IntPtr hhk);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);

    [DllImport(&quot;kernel32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr GetModuleHandle(string lpModuleName);
    #endregion

    // Constructor: set up a hook
    public UniversalHook() { }

    // Release the hook
    public void Dispose()
    {
        UnhookWindowsHookEx(hookID);
    }

    // Processes the event captured by the hook
    protected virtual IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam) 
    {
        return (System.IntPtr)1;
    }

    #region Event stuff

    // Delegate for Hook event handling
    public delegate void HookEventHandler(HookEventArgs e);

    // Event triggered when a keystroke is intercepted by the low-level hook
    public event HookEventHandler KeyIntercepted;

    // Raises the KeyIntercepted event.
    public void OnKeyIntercepted(HookEventArgs e)
    {
        if (KeyIntercepted != null)
            KeyIntercepted(e);
    }

    // Event arguments for the KeyIntercepted event
    public class HookEventArgs : EventArgs
    {
        private int iKeyCode;

        public HookEventArgs(int VK_KeyCode)
        {
            iKeyCode = VK_KeyCode;
        }

        public int KeyCode
        {
            get { return iKeyCode; }
        }
    }
    #endregion
}

public class KeyboardHook : UniversalHook
{
    //API constants
    private const int WH_KEYBOARD_LL = 13;    
    private const int WM_KEYUP = 0x0101;
    private const int WM_SYSKEYUP = 0x0105;

    // Constructor: set up a keyboard hook to trap all keystrokes
    public KeyboardHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; (wParam == (IntPtr)WM_KEYUP || wParam == (IntPtr)WM_SYSKEYUP))
            OnKeyIntercepted(new HookEventArgs((int)lParam));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, lParam);
    }
}

public class MouseHook : UniversalHook
{
    // API constants
    private const int WH_MOUSE_LL = 14;
    private const int WM_LBUTTONDOWN = 0x0201;
    private const int WM_RBUTTONDOWN = 0x0204;

    // Constructor: set up a mouse hook
    public MouseHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_MOUSE_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_LBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(1));
        else if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_RBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(2));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, lParam);
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/167896/keyhook-legt-sondertasten-lahm</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 05:25:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/167896.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Dec 2006 10:36:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 10:36:27 GMT]]></title><description><![CDATA[<p>hallo<br />
ich habe mir einen code zum auffangen von tastenanschlägen und mausklicks gebastelt. fängt soweit auch alles auf, nur funktionieren die sondertasten von meiner ms multimedia tastatur nicht mehr wenn der hook aktiv ist. hat hier jemand eine idee??</p>
<p>gruss peter h</p>
<p>mein code:</p>
<pre><code class="language-csharp">using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

public class UniversalHook : IDisposable
{
    //Variables used in the call to SetWindowsHookEx
    protected HookHandlerDelegate proc;
    protected IntPtr hookID = IntPtr.Zero;
    protected delegate IntPtr HookHandlerDelegate(int nCode, IntPtr wParam, ref IntPtr lParam);

    #region DllImports
    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr SetWindowsHookEx(int idHook, HookHandlerDelegate lpfn, IntPtr hMod, uint dwThreadId);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    protected static extern bool UnhookWindowsHookEx(IntPtr hhk);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);

    [DllImport(&quot;kernel32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr GetModuleHandle(string lpModuleName);
    #endregion

    // Constructor: set up a hook
    public UniversalHook() { }

    // Release the hook
    public void Dispose()
    {
        UnhookWindowsHookEx(hookID);
    }

    // Processes the event captured by the hook
    protected virtual IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam) 
    {
        return (System.IntPtr)1;
    }

    #region Event stuff

    // Delegate for Hook event handling
    public delegate void HookEventHandler(HookEventArgs e);

    // Event triggered when a keystroke is intercepted by the low-level hook
    public event HookEventHandler KeyIntercepted;

    // Raises the KeyIntercepted event.
    public void OnKeyIntercepted(HookEventArgs e)
    {
        if (KeyIntercepted != null)
            KeyIntercepted(e);
    }

    // Event arguments for the KeyIntercepted event
    public class HookEventArgs : EventArgs
    {
        private int iKeyCode;

        public HookEventArgs(int VK_KeyCode)
        {
            iKeyCode = VK_KeyCode;
        }

        public int KeyCode
        {
            get { return iKeyCode; }
        }
    }
    #endregion
}

public class KeyboardHook : UniversalHook
{
    //API constants
    private const int WH_KEYBOARD_LL = 13;    
    private const int WM_KEYUP = 0x0101;
    private const int WM_SYSKEYUP = 0x0105;

    // Constructor: set up a keyboard hook to trap all keystrokes
    public KeyboardHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; (wParam == (IntPtr)WM_KEYUP || wParam == (IntPtr)WM_SYSKEYUP))
            OnKeyIntercepted(new HookEventArgs((int)lParam));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, lParam);
    }
}

public class MouseHook : UniversalHook
{
    // API constants
    private const int WH_MOUSE_LL = 14;
    private const int WM_LBUTTONDOWN = 0x0201;
    private const int WM_RBUTTONDOWN = 0x0204;

    // Constructor: set up a mouse hook
    public MouseHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_MOUSE_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref IntPtr lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_LBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(1));
        else if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_RBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(2));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, lParam);
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1192861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192861</guid><dc:creator><![CDATA[peter_h]]></dc:creator><pubDate>Sat, 16 Dec 2006 10:36:27 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 11:58:23 GMT]]></title><description><![CDATA[<p>Eventuell solltest du die Tastenereignisse, die du nicht selber verarbeiten willst, an dein System zurückgeben - dann hat es die Chance, sie an andere interessierte Programm weiterzuleiten.</p>
<p>(unter WinAPI C++ verwendet man afaik die CallNextHookEx(), wie die entsprechende C# Funktion heißt, weiß ich nicht)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192914</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192914</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 16 Dec 2006 11:58:23 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 12:04:40 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Die Funktion CallNextHookEx wird am Ende der Funktion HookCallback aufgerufen. Die Standarttasten funktionieren ja problemlos, nur z.B. die Multimediatasten und Hotkeys arbeiten nicht mehr.</p>
<p>Gruss Peter H</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192916</guid><dc:creator><![CDATA[peter_h]]></dc:creator><pubDate>Sat, 16 Dec 2006 12:04:40 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 12:24:54 GMT]]></title><description><![CDATA[<p>Hast du das Programm mal durch den Debugger laufen lassen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192922</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 16 Dec 2006 12:24:54 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 13:04:07 GMT]]></title><description><![CDATA[<p>Ja, habe schon versucht mit dem Debugger etwas zu erkennen, aber weis nicht genau worauf ich achten soll. CallNextHookEx() wird jedenfall immer korrekt aufgerufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1192938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192938</guid><dc:creator><![CDATA[peter_h]]></dc:creator><pubDate>Sat, 16 Dec 2006 13:04:07 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Sat, 16 Dec 2006 14:53:01 GMT]]></title><description><![CDATA[<p>Problem gelöst...<br />
Es hat nicht gereicht einfach lParam weiterzuleiten, sondern man muss die KBDLLHOOKSTRUCT verwenden die der Hook zurückgiebt. Hat irgendwie etwas mit dem ScanCode bei den Sondertasten zu tun.</p>
<p>Hier der bereinigte Code. Vielleicht hilfts mal jemandem:</p>
<pre><code class="language-csharp">using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

public class UniversalHook : IDisposable
{
    //Variables used in the call to SetWindowsHookEx
    protected HookHandlerDelegate proc;
    protected IntPtr hookID = IntPtr.Zero;
    protected delegate IntPtr HookHandlerDelegate(int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam);

    // Structure returned by the hook
    protected struct KBDLLHOOKSTRUCT
    {
        public int vkCode;
        int scanCode;
        public int flags;
        int time;
        int dwExtraInfo;
    }

    #region DllImports
    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr SetWindowsHookEx(int idHook, HookHandlerDelegate lpfn, IntPtr hMod, uint dwThreadId);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    protected static extern bool UnhookWindowsHookEx(IntPtr hhk);

    [DllImport(&quot;user32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam);

    [DllImport(&quot;kernel32.dll&quot;, CharSet = CharSet.Auto, SetLastError = true)]
    protected static extern IntPtr GetModuleHandle(string lpModuleName);
    #endregion

    public UniversalHook() 
    { 
        // set up desired hook using SetWindowsHookEx
    }

    // Release the hook
    public void Dispose()
    {
        UnhookWindowsHookEx(hookID);
    }

    // Processes the event captured by the hook
    protected virtual IntPtr HookCallback(int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam) 
    {
        return (System.IntPtr)1;
    }

    #region Event stuff

    // Delegate for Hook event handling
    public delegate void HookEventHandler(HookEventArgs e);

    // Event triggered when a keystroke is intercepted by the low-level hook
    public event HookEventHandler KeyIntercepted;

    // Raises the KeyIntercepted event.
    public void OnKeyIntercepted(HookEventArgs e)
    {
        if (KeyIntercepted != null)
            KeyIntercepted(e);
    }

    // Event arguments for the KeyIntercepted event
    public class HookEventArgs : EventArgs
    {
        private int iKeyCode;

        public HookEventArgs(int VK_KeyCode)
        {
            iKeyCode = VK_KeyCode;
        }

        public int KeyCode
        {
            get { return iKeyCode; }
        }
    }
    #endregion
}

public class KeyboardHook : UniversalHook
{
    //API constants
    private const int WH_KEYBOARD_LL = 13;    
    private const int WM_KEYUP = 0x0101;
    private const int WM_SYSKEYUP = 0x0105;

    // Constructor: set up a keyboard hook to trap all keystrokes
    public KeyboardHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; (wParam == (IntPtr)WM_KEYUP || wParam == (IntPtr)WM_SYSKEYUP))
            OnKeyIntercepted(new HookEventArgs(lParam.vkCode));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, ref lParam);
    }
}

public class MouseHook : UniversalHook
{
    // API constants
    private const int WH_MOUSE_LL = 14;
    private const int WM_LBUTTONDOWN = 0x0201;
    private const int WM_RBUTTONDOWN = 0x0204;

    // Constructor: set up a mouse hook
    public MouseHook()
	{
        proc = new HookHandlerDelegate(HookCallback);
        using (Process curProcess = Process.GetCurrentProcess())
        using (ProcessModule curModule = curProcess.MainModule)
        {
            hookID = SetWindowsHookEx(WH_MOUSE_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
        }
	}

    // Processes the key event captured by the hook
    protected override IntPtr HookCallback(int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam)
    {
        //Filter wParam for KeyUp events only
        if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_LBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(lParam.vkCode));
        else if (nCode &gt;= 0 &amp;&amp; wParam == (IntPtr)WM_RBUTTONDOWN)
            OnKeyIntercepted(new HookEventArgs(lParam.vkCode));

        //Pass key to next application
        return CallNextHookEx(hookID, nCode, wParam, ref lParam);
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1192977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1192977</guid><dc:creator><![CDATA[peter_h]]></dc:creator><pubDate>Sat, 16 Dec 2006 14:53:01 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Wed, 20 Dec 2006 11:44:03 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Hmm... vllt. hilfts ja klingt gut <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="😉"
    /> hatte auch vor, so ein Programm zu schreiben, und da bin ich hier auf deinen Code aufmerksam geworden.<br />
Nun hab ich mir den Code mal angesehen und finde ihn recht interessant. Aber wo schreibt man denn deinen Code rein, damit es funktioniert?<br />
Und muss man noch irgendwelche Libs, DLLs, sonstiges includen?</p>
<p>Hoffe auf eine schnelle Antwort.</p>
<p>Danke schonmal.</p>
<p>Gruß<br />
MWJK</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1195309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1195309</guid><dc:creator><![CDATA[MWJK]]></dc:creator><pubDate>Wed, 20 Dec 2006 11:44:03 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Wed, 20 Dec 2006 12:56:14 GMT]]></title><description><![CDATA[<p>Seit ihr nicht irgendwie im falschen Subforum :xmas2: ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1195365</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1195365</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 20 Dec 2006 12:56:14 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Tue, 26 Dec 2006 10:48:34 GMT]]></title><description><![CDATA[<p>hallo<br />
habe die antwort erst heute entdeckt.<br />
dlls, libs muss man keine mehr hinzufügen. ist im code schon geschehen.</p>
<p>diese anleitung funktioniert so unter visual studio 2005:<br />
<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="😉"
    /> den kompletten code in eine datei kopieren und deinem projekt hinzufügen<br />
<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="😉"
    /> um den hook zu verwenden musst du eine neue objekt instanz erzeugen. das habe ich in der Program.cs die von vs erstellt wird gemacht:</p>
<pre><code class="language-csharp">...
public static KeyboardHook kh;
public static MouseHook mh;
static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (kh = new KeyboardHook())
            using (mh = new MouseHook())
            {
                Application.Run(new FormMain());
            }
        }
...
</code></pre>
<p><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="😉"
    /> ab sofort wird bei jedem tastendruck ein event gefeuert, dass man verarbeiten kann</p>
<pre><code class="language-csharp">public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
            Program.kh.KeyIntercepted += new UniversalHook.HookEventHandler(OnKeyInterceptedHandler);
            Program.mh.KeyIntercepted += new UniversalHook.HookEventHandler(OnKeyInterceptedHandler);
        }

        void OnKeyInterceptedHandler(UniversalHook.HookEventArgs e)
        {
            dataGridViewEvents.Rows.Add(new object[] { e.vkCode, e.scanCode, e.flags, e.time, e.dwExtraInfo });
        }
        ...
    }
</code></pre>
<p>hoffe die erklärung ist ausreichend. tut mir leid wenn das evtl. im falschen forum steht, aber die frage war ursprünglich zur winapi.</p>
<p>gruss peter_h</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1197930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1197930</guid><dc:creator><![CDATA[peter_h]]></dc:creator><pubDate>Tue, 26 Dec 2006 10:48:34 GMT</pubDate></item><item><title><![CDATA[Reply to keyhook legt sondertasten lahm on Thu, 28 Dec 2006 22:18:29 GMT]]></title><description><![CDATA[<p>Thx für die erklärung.</p>
<p>Tut mir auch leid, sollte ich diese Frage im falschen Forum gestellt haben, aber der Thread war leider hier schon eröffnet und deshalb hatte ich meine Frage angehangen.</p>
<p>Gruß<br />
MWJK</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1199230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1199230</guid><dc:creator><![CDATA[MWJK]]></dc:creator><pubDate>Thu, 28 Dec 2006 22:18:29 GMT</pubDate></item></channel></rss>