KEYBOARD ACCELERATORS

Described as simply as possible, keyboard accelerators are key combinations that generate WM_COMMAND (or in some cases WM_SYSCOMMAND) messages. Most often, programs use keyboard accelerators to duplicate the action of common menu options. (However, keyboard accelerators can also perform nonmenu functions.) For instance, many Windows programs have an Edit menu that includes a Cut option; these programs conventionally assign the Del key as a keyboard accelerator for this option. The user can choose the Cut option from the menu by pressing an Alt-key combination or can use the keyboard accelerator by simply pressing the Del key. When the window procedure gets a WM_COMMAND message, it does not have to determine whether the menu or the keyboard accelerator was used.