Solved

C# - Creating a Global Windows Keyboard Shortcut

Posted on 2010-08-29
4
738 Views
Last Modified: 2013-12-17
Hello,

For our office management application, we wish to have a global Windows shortcut to perform particular actions in our program.  Most specifically, to open a new Form to interact with the user.

By comparison, we wish to function much like the Google Desktop application -- whereby pressing "Control, Control" will cause a new window / Form to appear on the user's screen, and prompt them for a search query.

Please indicate how a Windows-wide shortcut can be made, instead of just an application-specific keyboard shortcut.

Thank you in advance.
0
Comment
Question by:millweb
4 Comments
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33553552
I don't belive the framework has this built into managed code yet. If it does I couldn't find it but there is a couple different ways you can do this using Pinvoke.
RegisterHotKey
http://msdn.microsoft.com/en-us/library/ms646309(VS.85).aspx
GetAsyncKeyState
http://msdn.microsoft.com/en-us/library/ms646293(VS.85).aspx

 
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 33553577
You can use a low level keyboard hook via WH_KEYBOARD_LL:
http://www.codeproject.com/KB/cs/globalhook.aspx
0
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 33554315
0
 
LVL 4

Expert Comment

by:Veerabhadraiahhv
ID: 33557581
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now