Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A version of this page is also available for
4/8/2010
This function displays a floating pop-up menu at the specified location and tracks the selection of items on the pop-up menu. The floating pop-up menu can appear anywhere on the screen.
BOOL TrackPopupMenuEx(
HMENU hmenu,
UINT uFlags,
int x,
int y,
HWND hwnd,
LPTPMPARAMS lptpm
);
If you specify TPM_RETURNCMD in the uFlags parameter, the return value is the menu-item identifier of the item that the user selected. If the user cancels the menu without making a selection, or if an error occurs, then the return value is zero.
If you do not specify TPM_RETURNCMD in the uFlags parameter, the return value is nonzero if the function succeeds and zero if it fails. To get extended error information, call GetLastError.
For Windows CE 1.0 and 1.01, the lptpm parameter is not supported and must be set to NULL. This parameter is supported in versions 2.0 and later.
Header | winuser.h |
Library | Menu.lib |
Windows Embedded CE | Windows CE 1.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
CreatePopupMenu
GetSubMenu
TPMPARAMS
TrackPopupMenu
WM_COMMAND
Menus Functions
Please sign in to use this experience.
Sign in