CreatePopupMenu ( window )
Parameters
| window - window that owns the popup menu |
Description
|
Creates a popup (context) menu root for a window and returns its handle. Requires Extended language mode. A popup menu is a logical menu root owned by the window but not attached to its menu bar. Build its contents exactly like any other menu: CreateMenu adds items (with tags for EventData), an empty text makes a separator, items with children become submenus, and CheckMenu, EnableMenu and SetMenuText all work on its descendants. Show it with ShowPopupMenu over any gadget belonging to the same window - by default at the mouse cursor, which is how you answer a right-click on an asset list with a context menu. Picking an item produces the ordinary menu-action event ($1001) with the item's tag in EventData and EventSource 0; cancelling the popup produces nothing. One popup can serve several triggers - the selection sample opens the same menu from a button and from a right-click. Native menu resources only exist while the popup is open, so there is no UpdateWindowMenu step: changes you make between showings simply appear next time. See it working in the selection and context menus sample. See also: ShowPopupMenu, CreateMenu, CheckMenu, EnableMenu, WindowMenu, EventData. |
Index