Keyboard hook with Visual Studio 2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!
I have some problems to create keyboard hook with Visual Studio 2005.
I have created this small solution:
http://www.igordamiani.it/WindowsApplication2.zip

With VS2003, it's all correct.
With VS2005, i obtain an exception

In particular, this is the line that fails:
keybhook = SetWindowsHookEx(WH_KEYBOARD_LL, kbcatcher,
Marshal.GetHINSTANCE(typeof(KeyboardHook).Module),0);

keybhook equals 0, and no hook on keyboard is created...
Can you help me, please?
 
Select your project in VS 2005, click the Properties button. In the "Debug"
tab, under "Enable Debuggers", uncheck the box "Enable the Visual Studio
Hosting Process".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top