2.2.6.20.20 Menu::TrackPopupMenu

Description

Displays a floating pop-up menu at the specified location and tracks the selection of items on the pop-up menu. A floating pop-up menu can appear anywhere on the screen. call this member for internal menu, which are not created from resource.

Syntax

BOOL TrackPopupMenu( UINT nFlags, int x, int y, HWND hwnd, int * pnCmdSelected = NULL )

Parameters

nFlags
Specifies a screen-position flag and a mouse-button flag. The screen-position flag can be one of the following:
TPM_CENTERALIGN Centers the pop-up menu horizontally relative to the coordinate specified by x.
TPM_LEFTALIGN Positions the pop-up menu so that its left side is aligned with the coordinate specified by x.
TPM_RIGHTALIGN Positions the pop-up menu so that its right side is aligned with the coordinate specified by x.
The mouse-button flag can be either of the following:
TPM_LEFTBUTTON Causes the pop-up menu to track the left mouse button.
TPM_RIGHTBUTTON Causes the pop-up menu to track the right mouse button.
x
Specifies the horizontal position in screen coordinates of the pop-up menu.
y
Specifies the vertical position in screen coordinates of the top of the menu on the screen.
hwnd
handle to the owner window
pnCmdSelected
if not null receives the command ID of the menu item selected (0 if none is selected).

Return

returns the return value of the handler function, if handled else false

Examples

Remark

See Also

Menu::TrackPopupResMenu

Header to Include

Control.h