Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have MFC application which has around 10 image buttons to which we want to provide shortcut keys. Shortcuts will be customizable. I have implemented shortcuts (with no customization right now) with hotkeys using ON_WM_HOTKEY() message.

After searching through Goolge I am little confuse. For example, this question is suggesting hotkey is global for OS, and Accelerator is global for application.

Which one I should use with my application. My shortcut keys will be like Ctrl + Shift + A, and will be customizable.

Secondly, where to keep them. Is it usual to store shortcuts in Windows Registry?
Posted
Comments
Richard MacCutchan 18-Jun-15 3:57am    
Do not use hot keys. As Google tells you, they are system wide so will not be the optimum choice. Use accelerators as described in the Win32/MFC documentation.
kpranit 18-Jun-15 4:46am    
Thanks.

1 solution

For an Windows App you best use an accelator table, which also can be a resource and some handling.

It is fine to store such values in the user registry of your app, but do some checking after loading it, because an attacker or some curios user may change them to some strange values.

If you are clever you store only the command ID of the user settings, and you reproduce the correct WM_COMMAND-message. :-O
 
Share this answer
 

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