The DestroyMenu function destroys the specified menu and frees any memory that the menu occupies.
BOOL DestroyMenu(
HMENU hMenu |
// handle to menu to destroy |
); |
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.
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.