Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
Need ur help i am working on WPF project it working fine...now its consist a settings from ...(my project is running on back ground)now i want to impalement some short cut key which can invoke the setting form i.e CTRL+ALT+S
Please help me .
Any Help will be appreciated.

Lakhan
Posted
Comments
[no name] 23-Apr-13 8:07am    
If your application does not have the focus, you need to create a global key hook.
[no name] 24-Apr-13 8:33am    
thanks ...done

1 solution

C#
private void YourEventHandler(object sender, KeyEventArgs e)
{
     if (System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.S) &&
         System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LeftCtrl) &&
         System.Windows.Input.Keyboard.IsKeyDown(System.Windows.Input.Key.LeftAlt))
       {
             // new SettingsWindow().ShowDialog();
       }
}
 
Share this answer
 
Comments
[no name] 25-Apr-13 3:51am    
thanks .....
tumbledDown2earth 25-Apr-13 5:12am    
thanks for thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900