The ChangeMenu function has been replaced with five specialized functions. These new functions are:
Function | Description |
AppendMenu | Appends a menu item to the end of a menu. |
DeleteMenu | Deletes a menu item from a menu, destroying the menu item. |
InsertMenu | Inserts a menu item into a menu. |
ModifyMenu | Modifies a menu item in a menu. |
RemoveMenu | Removes a menu item from a menu but does not destroy the menu item. |
Applications written for versions of Windows previous to 3.0 may continue to call ChangeMenu as previously documented. Applications written for Windows 3.0 and later should call the new functions listed above.
This example shows an example of a call to ChangeMenu, and how the call would be rewritten to call AppendMenu:
ChangeMenu(hMenu, /* handle of the menu */
0, /* not used */
"&White", /* menu-item string */
IDM_PATTERN1, /* ID of menu item */
MF_APPEND | MF_STRING | MF_CHECKED); /* flags */
AppendMenu(hMenu, /* handle of the menu */
MF_STRING | MF_CHECKED, /* flags */
IDM_PATTERN1, /* ID of menu item */
"&White"); /* menu-item string */
AppendMenu, DeleteMenu, InsertMenu, ModifyMenu, RemoveMenu