Re: How to get Acceleration Key for specific MenuItem ?

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

From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 07/27/04


Date: Mon, 26 Jul 2004 22:20:39 -0400

If the accelerator you want is the underlined letter, you should be able to
do this with GetMenuItemInfo (assuming the menu's not in your app). Then
look in the string for a single & character, and the next character is the
accelerator key. If && is present skip it, as that's the code to print an
actual ampersand, as in "Open && Save" = "Open & Save". Although I don't
have a demo ready, the code at
http://vbnet.mvps.org/code/menu/radiobutton.htm shows calling this API.

-- 
Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"[SolarAngel]" <not-for-mail> wrote in message 
news:uD54pJ2cEHA.2236@TK2MSFTNGP10.phx.gbl...
: I need to pass handle to menu item and retrieve Acceleration key for that 
menu item, is this possible?
:
: Thanks!
:
: [SolarAngel]
:
: 


Relevant Pages

  • Standard names for common keyboard events
    ... gives unique names to common keyboard events. ... The item string for the normal menu items ... The accelerator string follows the item label and is ... The accelerator may be any alphanumeric character, ...
    (comp.lang.python)
  • Re: Detect if a KeyStroke is a real character or not.
    ... John B. Matthews wrote on 18.02.2009 21:02: type the character produced by that KeyStroke. ... Similarly, I would not set a menuItem's accelerator to Meta-C: it might look familiar on my platform, but it would be awkward on others. ... As I said AltGr or Ctrl-Alt do the same thing on Windows. ... MacOS adds the "option" key for which I don't even know what the modifier value in Java would be. ...
    (comp.lang.java.gui)
  • Re: Detect if a KeyStroke is a real character or not.
    ... type the character produced by that KeyStroke. ... menu accelerator modifier, because getMenuShortcutKeyMasktells you. ... getMenuShortcutKeyMaskis a "real" character on my platform. ...
    (comp.lang.java.gui)
  • Re: Bug In CommandButton Accelerator Key Code
    ... Confirmed in 2003 SP1 ... > underlined to show the user that it's the accelerator key. ... > the double ampersand as meaning "I want a literal single ampersand ... > character" but it then miscounts which character should be underlined ...
    (microsoft.public.access.forms)
  • RE: Bug In CommandButton Accelerator Key Code
    ... > show the user that it's the accelerator key. ... It correctly interprets the ... > double ampersand as meaning "I want a literal single ampersand character" but ...
    (microsoft.public.access.forms)