How to catch a key in windows

Hi,
I need to activate my program if PrintScreen key is pressed and focus is on some else program.
Thank you.



Answer this question

How to catch a key in windows

  • GrayMatter Software

    You can use windows hook to do this

    http://www.codeproject.com/csharp/NetWin32Hooks.asp.

    Install keyboard hook, check for printscreen key and do your stuff


  • Rick Frankel

    Stay away from com objects.  You can set up a keyevent monitor in you program, parse the input to determine the key pressed and directly call your program via a shell.  The dotnet framework has all the classes you need to do this.

  • How to catch a key in windows