Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>George Mamaladze's article <a href="http://www.codeproject.com/KB/cs/globalhook.aspx" rel="nofollow noreferrer">Processing Global Mouse and Keyboard Hooks in C#</a> which works if the application is "in the background" on CodeProject has been around since 2004, been through multiple revisions, and he's still supporting it and updating it : as I understand it, he started his project because he could not implement global hooks in .NET, that worked when the app was running in the background, but later discovered you could hook certain "lower level" events : <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;318804" rel="nofollow noreferrer">formerly Q318804 : now MSDN article revised (?) that says you can hook WH_KEYBOARD_LL</a>. </p> <p>Perhaps, since George's code has been field-tested by so many C# programmers, over so many years, and extensively revised against bugs or problems : there's some possible value in his code for you ? In his article, in the Version 1 "FAQ" he shows code that will make the hook application specific, rather than global.</p> <p>The MSDN article cited above mentions ... in the context of the allowed hooking of low level events, as you are doing :</p> <blockquote> <p>"Low-level hook procedures are called on the thread that installed the hook. Low-level hooks do not require that the hook procedure be implemented in a DLL."</p> </blockquote> <p>Hypothesis : could threading be related to what you are observing ?</p> <p>I'm assuming you've already been through and considered all the details on : <a href="http://msdn.microsoft.com/en-us/library/ms644985(VS.85).aspx" rel="nofollow noreferrer">MSDN : LowLevelKeyboardProc Function</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload