views:

156

answers:

2

How would I have my C# program listen for a specific keyboard combination (say, CTRL+ALT+F2) globally. Even if my application is minimized I would want it to intercept this and do something.

+1  A: 

You will have to use the Windows API to set a system hook into the keyboard. Here is a pretty good article on how to do such a thing:

http://www.codeguru.com/vb/gen/vb%5Fsystem/keyboard/article.php/c4829/

Ed Swangren
A: 

You can also take a look at http://www.liensberger.it/web/blog/?p=207 which is written in C#

armannvg