.NET Framework Bookmark and Share   
 index > .NET Base Class Library > How to catch a key in windows
 

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.
gibic
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.
Mr. Javaman

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

Vadmyst
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.
Mr. Javaman

You can use google to search for other answers

Custom Search

More Threads

• Thread Join() timeout
• dictionary values are case sensitive
• Speech
• Garbage collector and (virtual) memory release in a multithreaded application
• Directory creation .....
• Replace a value in a Dictionary
• Using Reflection to link to event with custom handler
• Error in creating a new registry key
• prorgamFilesPath
• TraceListener.TraceEvent: Why do I need a numeric identifier for the event?