BOOL SetMenu(hwnd, hmenu) | ||||
HWND hwnd; | /* handle of window, */ | |||
HMENU hmenu; | /* handle of menu, */ |
The SetMenu function sets the given window's menu to the specified menu.
hwnd
Identifies the window whose menu is to be changed.
hmenu
Identifies the new menu. If this parameter is NULL, the window's current menu is removed.
The return value is nonzero if the function is successful. Otherwise, it is zero.
The SetMenu function causes the window to be redrawn to reflect the menu change.
SetMenu will not destroy a previous menu. An application should call the DestroyMenu function to accomplish this task.
HMENU hmenu;
hmenu = LoadMenu(hinst, "My Menu");
SetMenu(hwnd, hmenu);