What is the best way to implement a hotkey? My program may be minimized or without focus or even hidden. I would like to press a key combination and have it restored and have focus. Can you have more than one hotkey for other functions? I only have 26 points. I'll keep one.
Who is Participating?
MadshiConnect With a Mentor Commented:
Thanx, CalvinDay...   :-)
Hello Calvin

I believe the only hot keys available to your app when it is minimised or doesn't have focus, are those assigned by Windows.

Goto Properties command from context menu of your menu short cut, the enter a hot key in the ShortCut Key field (hold down Alt and press a key).

This shortcut will restore your app if minimised and/or bring it to front if it is not already.


Look at WM_SETHOTKEY and RegisterHotKey. I didn't use any of them yet. So you'll have to test them yourself. Another possibility is the hotkey in the shellLink (lik HTH suggested). Another possibility would be a system wide keyhook dll. Look at the other question (200 points from "Carier" or someone with a similar name to that).

Regards, Madshi.
CalvinDayAuthor Commented:
WM_SETHOTKEY and RegisterHotKey seem to work. Madshi, answer this question.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.