Re: Equivalent to GetKeyNameText for WM_APPCOMMAND messages?




"GregM" <gregm@xxxxxxxxxxxxxxxxx> wrote in message
news:C91F06D3-7218-49CE-A6C3-6FC9C24479A9@xxxxxxxxxxxxxxxx
> > Is there an equivalent of the GetKeyNameText API for the WM_APPCOMMAND
> > messages? I need to create user-readable strings to use in my keyboard
> > mapping dialog, and I'd rather not have to create strings for each of
these
> > buttons, which then need to be localized, if Windows provides an API to do
> > this for me.
> >
> > This is in VC++ 7.1 (2003), Win2K and higher.
>
> Well, I found the VK_ constants for the WM_APPCOMMAND values that are
> available in Win2K or higher, but when I send them through MapVirtualKeyEx
> and then GetKeyNameText, I get just single english characters. I tried this
> both with and without setting the "extended key" bit. I also get the same
> results for a CHotKeyCtrl if I press one of the command buttons when it has
> the focus. (I'm quite surprised that a CHotKeyCtrl would even react to
these
> buttons in the first place.)

MapVirtualKeyEx is not going to be useful in reference to WM_APPCOMMAND.
WM_APPCOMMAND has nothing directly to do with keyboard input.

To the best of my knowledge, there's no API to map WM_APPCOMMAND messages
to text strings. It should be reasonably simple to create your own.

--

-GJC [MS Windows SDK MVP]
-Software Consultant (Embedded systems and Real Time Controls)
- http://www.mvps.org/ArcaneIncantations/consulting.htm
-gchanson@xxxxxxxx


.