There are bugs in the original, because this is the code I converted from C #, where the original conversion was not fully compatible because of the different nature of the two languages.
Of course, now I am fully capable of compatible with the characteristics of both languages, so rewrite this code, the original code in the event detection, as well as the original code in the KeyPress time can not detect input character casing bug elimination (thanks to Comrade Verywzm).
Note: If this code wants to run in VS, remove the check from the [engineering properties]-[Debug]-[Start Visual Studio Hosting process], or use CTRL+F5 for compile-Time debugging!
This code contains dangerous code, please do not use for illegal purposes!
-------------------------------------------------------------------
This is real. NET environment, the global keyboard Mouse hook code!
This code is from CodeProject, the original author Michael Kennedy,c# encoded.
I translated this section of C # source code for VB, because there are some differences in the internal mechanism of the two languages, so I made a big change. Not easy AH ~ ~
The following code is I modify and expand the code, to retain all rights, pirated copy, piracy shameful.
Using the method is simple, create a new class file, copy the code aggressively, and then add an instance of the type to a blank area of a form.
Dim WithEvents Myhook as New Systemhook ()
Then you can use the static binding event.