The SetMenu function assigns a new menu to the specified window.
BOOL SetMenu(
HWND hWnd, |
// handle of window |
HMENU hMenu |
// handle of 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.