CMenu::CreatePopupMenu

Syntax

BOOL CreatePopupMenu();

Remarks

Creates a pop-up menu and attaches it to the CMenu object.

The menu is initially empty. Menu items can be added by using the AppendMenu or InsertMenu member functions. The application can add the pop-up menu to an existing menu or pop-up menu. TrackPopupMenu may be used to display this menu as a floating pop-up menu.

If the menu is assigned to a window, it is automatically destroyed when the window is destroyed. If the menu is added to an existing menu, it is automatically destroyed when that menu is destroyed.

Return Value

TRUE if the pop-up menu was successfully created; otherwise FALSE.

See Also

CMenu::CreateMenu, CMenu::InsertMenu, CWnd::SetMenu, CMenu::TrackPopupMenu, ::CreatePopupMenu