Changing the Menu

We've already seen how the AppendMenu function can be used to define a menu entirely within a program and to add menu items to the system menu. Prior to Windows 3, you would have been forced to use the ChangeMenu function for this job. ChangeMenu was so versatile that it was one of the most complex functions in all of Windows. In Windows 3, ChangeMenu is still available, but its functionality has been divided among five new functions:

AppendMenu adds a new item to the end of a menu.

DeleteMenu deletes an existing item from a menu and destroys the item.

InsertMenu inserts a new item into a menu.

ModifyMenu changes an existing menu item.

RemoveMenu removes an existing item from a menu.

The difference between DeleteMenu and RemoveMenu is important if the item is a popup menu. DeleteMenu destroys the popup menu—but RemoveMenu does not.