Assign Operating system shortcut key to event in program

G

Guest

Hi,

I've made an application that is running in the background - i.e. its not
visible on the screen.

I would like an eventhandler in the program to subscribe to the event that
occurs when, say the windowskey+(some free key) is pressed. A little like the
way you can start the file Explorer from windowskey+E, except that I do not
want to start an app, but invoke an eventhandler in an already running
program.

Is this possible.

Best regards
Jesper, Denmark.
 
M

Marc Gravell

You can do a lot of what you want by creating a global hotkey; in .Net, one
way to do this is by re-using the SystemHotkey code from CodeProject (google
SystemHotkey - it should be the top hit: if not, add CodeProject).

I'm not sure if you can hook into the Windows key, but many other
combinations are available; watch out for a known bug (easily fixed) when
using multiple modifier keys (IIRC the bug is in RegisterHotKeys - something
to do with numeric rather than binary addition).

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top