I hope this response will help you along the way, although I can't promise you it will address the problem.
First, some general advice about re-using code from CodeProject articles:
1. first download the author's sample demo (if the article has one), and source code; confirm the sample demo runs on your OS version/machine without error.
2. open a Project using the author's source: confirm it will build and run on your OS/machine.
3. then verify the author's source will build and run if you change settings like 32/64, or re-compile in the version of Visual Studio you want to use.
If all of the above are okay, then adapt the author's code, add your own, test, debug.
If you didn't get this far, then go back to the article, read the comments carefully: there is a very good chance someone else may have posted a similar problem, and the author, or others, may have replied with good suggestions.
In your case, take a look at this comment thread on the article: [
^], which I think may be relevant to your problem.
And do post your own comment, or response to other comments: it never hurts to ask !
Finally, if you just can't get it to work, and can't get help, consider looking around in CodeProject for other solutions of the same type: there are several GlobalHook articles here. The one I recommend is by George Mamaladze (just search).
Unfortunately, when you are working with Global Hooks you are "coding outside the box" of .NET, using API's, and debugging is going to be a problem.