The SetMenu function assigns a new menu to the specified window.
BOOL SetMenu(
HWND hWnd, // handle to window
HMENU hMenu // handle to menu
);
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.
The window is redrawn to reflect the menu change.
The SetMenu function replaces the previous menu, if any, but it does not destroy it. An application should call the DestroyMenu function to accomplish this task.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Menus Overview, Menu Functions, DestroyMenu, GetMenu