Simple question about '&'

Hi! I'm following a tutorial on creating win apps with WinAPI, and I'm curius about the '&' sign in the line
"E&xit"
. Why is it there? It's not showing up in the menu, and still between two ".

Can someone please explain why I need this '&'?

A part of the program code:
1
2
3
4
            hSubMenu = CreatePopupMenu();
            AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit");
            AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File");
http://msdn.microsoft.com/en-us/library/windows/desktop/ms647553%28v=vs.85%29.aspx#_win32_Menu_Access_Keys
Menu Access Keys

The standard keyboard interface for menus can be enhanced by adding access keys (mnemonics) to menu items. An access key is an underlined letter in the text of a menu item. When a menu is active, the user can select a menu item by pressing the key that corresponds to the item's underlined letter. The user makes the menu bar active by pressing the ALT key to highlight the first item on the menu bar. A menu is active when it is displayed.

To create an access key for a menu item, precede any character in the item's text string with an ampersand. For example, the text string "&Move" causes the system to underline the letter "M".
Last edited on
Thank you =)
Topic archived. No new replies allowed.