SetMenu

Syntax

BOOL SetMenu(hWnd,hMenu)

This function sets the given window's menu to the menu specified by the hMenu parameter. If hMenu is NULL, the window's current menu is removed. The SetMenu function causes the window to be redrawn to reflect the menu change.

Parameter Type/Description  

hWnd HWND Identifies the window whose menu is to be changed.  
hMenu HMENU Identifies the new menu.  

Return Value

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

Comments

SetMenu will not destroy a previous menu. An application should call the DestroyMenu function to accomplish this task.