Windows includes a number of functions that you can use to modify a menu after you have loaded or created it. You can use the AppendMenu and InsertMenu functions to add items to a menu. AppendMenu appends a menu item to the end of a menu, InsertMenu inserts a menu item at a specified position in a menu. Both functions also let you specify the attributes of the menu item that you are adding, including whether it is enabled, checked, grayed, and so on.
You can use the ModifyMenu function to change the appearance or attributes of an existing menu item. For example, you could change the string or bitmap of a menu item and enable, disable, gray, check, or uncheck the item. When you use ModifyMenu, you are essentially replacing the specified menu item with a new item.
You can use the DeleteMenu and RemoveMenu functions to delete a menu item from a menu. If the item being deleted is a pop-up item, DeleteMenu deletes the associated pop-up menu, discarding the menu handle and freeing the memory used by the pop-up menu. The RemoveMenu function deletes a menu item but doesn't destroy the pop-up menu associated with a pop-up item, allowing you to save the handle and reuse it later.
After you modify a menu bar, you must call the DrawMenuBar function to redraw the menu bar. Otherwise, the modifications will not appear until Windows redraws the owner window.