Group: Menu - Library: user32
Attaching menu to a top-level form
BOOL SetMenu(
HWND hWnd, // handle to window
HMENU hMenu // handle to menu
);
DECLARE INTEGER SetMenu IN user32;
INTEGER hWnd,;
INTEGER hMenu
hWnd [in] Handle to the window to which the menu is to be assigned.
hMenu [in] Handle to the new menu. If this parameter is NULL, the window"s current menu is removed.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
A menu can be assigned to any window that is not a child window. For the VFP forms it means that only those with ShowWindow property equal to 2 (top-level windows) can accept the menu.
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.