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?
Hotkeys added via
RegisterHotKey
(or its equivalent in MFC) are definitely system global and you should not use them to trigger functions in your program unless you specifically want the user to be able to trigger them from anywhere.(e.g. your application might be a screenshot app, and so triggering a function from outside it would make sense)
Normally though you should use accelerators to add keyboard bindings for toolbar buttons etc.
Where you store them is up to you - I would say you should store them wherever you store the rest of your application's configuration data.