1

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)]
Community
  • 1
  • 1
Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286

3 Answers3

4

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.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
0

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

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
0

Related Q&A on Global Hook

Community
  • 1
  • 1