3

I try to run my WinForms app (Ctrl + Shift + R) with C#? like Bablyon dictionary:) I can not find any knowledgeable trick. Can you show me how to run app. with Ctrl + Shift combination?

I am using Visual Studio 2008, if it matters.

Jasper
  • 2,166
  • 4
  • 30
  • 50
Penguen
  • 16,836
  • 42
  • 130
  • 205

4 Answers4

6

I don't know what Babylon dictionary is, but chances are this is not implemented in C#. Windows has built-in functionality for launching applications with keyboard shortcuts. You can assign any combination you want to a particular shortcut, and whenever you press those keys, Windows will launch that program.

For example, you could assign the Calculator application to Ctrl+F12. To do this:

  1. Find or create a shortcut to the application you wish to launch. (Your Start menu or desktop is a good place to look.)

  2. Right-click on the shortcut, and select "Properties" from the drop-down menu.    

  3. In the Properties window, open the "Shortcut" tab and click in the "Shortcut Key" box.

  4. Press the key combination that you wish to use to start the application.        

  5. Finally, click OK. Now, pressing that key combination from anywhere should launch your application.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
2

i usually create a shortcut and do this

scatman
  • 14,109
  • 22
  • 70
  • 93
1

Are you referring to global hotkeys? Try this:

Best way to tackle global hotkey processing in c#?

Community
  • 1
  • 1
Ohad Schneider
  • 36,600
  • 15
  • 168
  • 198
  • This will only work if your application is already open. What you're doing is setting a low-level keyboard hook that your application can recognize, no matter what other application currently has the foreground focus. If you're trying to start your application for the first time, it won't be alive to listen for the hotkeys. – Cody Gray - on strike Dec 10 '10 at 12:12
  • I know, but since the OP mentioned he wants behavior similar to Babylon dictionary, I believe this is the behavior he's referring to. – Ohad Schneider Dec 10 '10 at 12:29
1

Thats a windows thing, isn't it? Open the properties dialog for the shortcut to you App. There you can press Ctrl + Shift + R in the Shortcut key textbox.

Jasper
  • 2,166
  • 4
  • 30
  • 50
Örjan Jämte
  • 14,147
  • 1
  • 23
  • 23