This topic has not yet been rated - Rate this topic

DestroyMenu function

Applies to: desktop apps only

Destroys the specified menu and frees any memory that the menu occupies.

Syntax

BOOL WINAPI DestroyMenu(
  __in  HMENU hMenu
);

Parameters

hMenu [in]

Type: HMENU

A handle to the menu to be destroyed.

Return value

Type: BOOL

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.

DestroyMenu is recursive, that is, it will destroy the menu and all its submenus.

Examples

For an example, see Displaying a Shortcut Menu.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
CreateMenu
DeleteMenu
RemoveMenu
SetMenuItemInfo
Conceptual
Menus

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ