7.2.1 Menu Identifiers

Each menu item is identified by a unique constant, usually called a menu identifier, which Windows passes to the application when the user chooses the command associated with the item. You define each menu identifier by using the #define directive in the resource-definition file or the header file, as in the following example:

#define IDM_EXIT         111
#define IDM_RECALC       112
#define IDM_SCYLLA       113
#define IDM_CHARYBDIS    114

You use menu identifiers to direct the flow of control, depending on which command the user chooses. For more information about handling menu input, see Section 7.4, “Processing Input from a Menu.”