DestroyMenu

The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies.

BOOL DestroyMenu(
  HMENU hMenu  // handle to menu to destroy
);
 

Parameters

hMenu
Handle to the menu to be destroyed.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Before closing, an application must use the DestroyMenu function to destroy a menu not assigned to a window. A menu that is assigned to a window is automatically destroyed when the application closes.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Menus Overview, Menu Functions, CreateMenu, DeleteMenu, RemoveMenu