Discussion:
How to read all shortcut keys of an application
(too old to reply)
JoDeGr8
2009-10-16 18:58:04 UTC
Permalink
Hi,
Is it possilbe to read all hotkeys(or shortcut keys) registered by an
application? For example the CTRL+S in MS Word?


Thanks in advance,

Regards,
John.
David Lowndes
2009-10-16 22:30:53 UTC
Permalink
Post by JoDeGr8
Is it possilbe to read all hotkeys(or shortcut keys) registered by an
application? For example the CTRL+S in MS Word?
John,

I suspect it won't be consistent between different applications. For
Office applications I'd have a look in to the object model - that may
expose the keyboard accelerators somehow.

Dave
Tim Roberts
2009-10-17 21:34:52 UTC
Permalink
Post by JoDeGr8
Is it possilbe to read all hotkeys(or shortcut keys) registered by an
application? For example the CTRL+S in MS Word?
Not all, but you can get some of them. One of the tables in an
application's resources is the ACCELERATORS table, which globally maps
keystrokes to actions. You can read that table from a program using the
normal resource APIs.

However, that's not universal. It won't help with accelerator keys in
dialogs (like &Load and &Save).
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Ben Voigt [C++ MVP]
2009-10-17 22:18:39 UTC
Permalink
Post by Tim Roberts
Post by JoDeGr8
Is it possilbe to read all hotkeys(or shortcut keys) registered by an
application? For example the CTRL+S in MS Word?
Not all, but you can get some of them. One of the tables in an
application's resources is the ACCELERATORS table, which globally maps
keystrokes to actions. You can read that table from a program using the
normal resource APIs.
Typically applications which allow menu and toolbar customization replace
TranslateMessage with their own function, which doesn't use the ACCELERATOR
resource.
Post by Tim Roberts
However, that's not universal. It won't help with accelerator keys in
dialogs (like &Load and &Save).
--
Providenza & Boekelheide, Inc.
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4518 (20091017) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4518 (20091017) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Continue reading on narkive:
Loading...