tags:

views:

51

answers:

3

I am reading few articles that explains hooking a key pressed by using globalKeyBoardHook() but didn't told where this dll is. How to get this class available. Please help how to get this dll. Is it a windows dll api or an external dll. ?

Currently I am reading this, this article and not getting anything.

Can anyone explain all the terms used in the line below. It seems that we are importing a dll. But why like this since we can add dll by right clicking on refrences folder. Any reason

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
A: 

Look in the GAC for these dlls. Visual Studio should automatically handle the references for you.

Woot4Moo
@Woot: thanks for help. How to get details about them
Shantanu Gupta
The names are kernel32.dll and user32.dll
Woot4Moo
@Woot: Do i need to add there refrences as no class is being displayed by default.
Shantanu Gupta
you need to write the class yourself, its just what he named it
Woot4Moo
A: 

Related Q&A on Global Hook

0A0D
+1  A: 

The globalKeyBoardHook class is just a class created by the author of the code project article you read here. If you look at that link you'll see a link called something like Download source - 29.62 KB. Try clicking on that link, downloading the file and inside there there'll be a globalKeyboardHook.cs file that you should add to your project.

That code will then call SetWindowsHookEx from user32.dll, but you don't really need to worry about that.

All in all, read through that article carefully, I think you might have missed some steps in how to use his code.

ho1