The Accelerator class

It is possible to add an accelerator to a menu item. The accelerator text is preceded by a tabulator character (\t) and the text is made up of the optional prefixes Ctrl+, Shift+, or Alt+ followed by a character (for instance, &Open\tCtrl+O) or the name of a virtual key (for instance, &Save\tAlt+F2).


namespace SmallWindows { 

The Win32 API holds a set of virtual keys with names beginning with VK_. In Small Windows, they have been given other names, hopefully easier to understand. The virtual keys available are: F1 - F12, Insert, Delete, Backspace, Tab, Home, End, Page Up, Page Down, Left, Right, Up, Down, Space, Escape, and Return:

 enum Keys {KeyF1 = VK_F1, KeyF2 = VK_F2, KeyF3 = VK_F3, KeyF4 = VK_F4, KeyF5 = ...

Get C++ Windows Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.