Re: Equivalent to GetKeyNameText for WM_APPCOMMAND messages?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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


.



Relevant Pages

  • Re: substring finding problem!
    ... A programming competition seemed to break out ... overlapping strings", though whether it's actually clearer might ... string is rescanned even be part of the API? ... at the big-O level of abstraction. ...
    (comp.lang.c)
  • PInvoke Issues...
    ... I think I'm having PInvoke issues because I imported the service API ... strings and the DWORD correctly - yes? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: DLL Marshalling : How do I treat a char FAR * HUGE * FAR * in C# ?
    ... The P/Invoke layer doesn't know how to marsal arrays back to the managed ... are you supplying the memory where the strings are written to? ... > API call by doing a type conversion for each parameter. ... > public static extern int XcDatabaseCodes( ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Compare words (not Strings)
    ... > In the core API, Strings can be checked either case sensitively are ... > use Soundex, Metaphone, or Levenshtein. ... > Soundex and Metaphone return Strings which are approximate pronunciations ... database might hold spices. ...
    (comp.lang.java.programmer)
  • Re: Suggested Alternative Unicode Implementation (for Rudy+ miscothers)
    ... Only if you were using strings other that UTF16 in your application. ... You want conversions? ... A versions of function prototypes as appropriate to an applications ... i.e. you have an ANSIString in your hand, you call the A API. ...
    (borland.public.delphi.non-technical)