SetMenu

  BOOL SetMenu(hwnd, hmenu)    
  HWND hwnd; /* handle of window */
  HMENU hmenu; /* handle of menu */

The SetMenu function assigns a new menu to the given window.

Parameters

hwnd

Identifies the window to which the menu is to be assigned.

hmenu

Identifies the new menu. If this parameter is NULL, the window's current menu is removed.

Return Value

The return value is nonzero if the menu is changed. Otherwise, it is zero.

Comments

The window is redrawn to reflect the menu change.

SetMenu replaces the previous menu, if any, but does not destroy it. An application should call the DestroyMenu function to accomplish this task.

See Also

DestroyMenu GetMenu