7.7 Sample Application: EditMenu

The EditMenu sample application illustrates the two most common menus, the Edit menu and the File menu, and shows how to use accelerator keys in an application.

Note:

The accelerator keys shown in this sample are reserved and should be used only as accelerator keys for the Edit menu.

To create the EditMenu application, make the following modifications to the Generic application:

1.Add the Edit and File menus to the resource-definition file.

2.Add definitions to the header file.

3.Add an accelerator table to the resource-definition file.

4.Add a new variable.

5.Load the accelerator table.

6.Modify the message loop in the WinMain function.

7.Modify the WM_COMMAND case.

8.Compile and link the application.

EditMenu does not show how to use the clipboard. This task is described in Chapter 13, “Clipboard.”