Reputation: 772
I am using this code for opening an application from C# keydown event
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F && e.Alt)
{
Process.Start(@"c:\ade.exe");
}
}
It's working perfectly, but when my windows form application is in working mode, I want to work it also when my app is minimized.
Upvotes: 1
Views: 5485
Reputation: 34180
Well the keydown (keyup, keypress , mousedown, ...) will work when your application is active and the control that you have written the code has the focus. if you want to get key strike any way. you can search in google and codeproject.com for examples of keyboard hook. here are some examples:
Upvotes: 0
Reputation: 25595
You'll have to use hooking for this,
I googled abit for you and came across this website. it's a small class that allows you to bind a Hotkey to your application, when once pressed - you can fire an event in your application.
Upvotes: 0
Reputation: 263903
You should create global hotkey.
Check this one
http://www.liensberger.it/web/blog/?p=207
Upvotes: 1