wpDisplayMenu
Appearance
This method is specific to version 3, or higher, of the OS/2 operating system.
This instance method creates and displays an object's popup context menu.
Syntax
_wpDisplayMenu(somSelf, hwndOwner, hwndClient, ptlPopupPt, ulMenuType, ulReserved)
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
- hwndOwner (HWND) - input
- Handle of the window that the menu is owned by. This parameter is required, and must not be **NULL**.
- hwndClient (HWND) - input
- Handle of the window on which the menu is displayed. This window must be owned by *hwndOwner*.
- If *hwndClient* is supplied:
- The pop-up point is assumed to be in *hwndClient* window coordinates.
- *hwndClient* is given the focus before displaying the menu.
- If *hwndClient* is not supplied:
- The pop-up point is assumed to be in *hwndOwner* window coordinates.
- *hwndOwner* is given the focus before displaying the menu.
- ptlPopupPt (POINTL *) - input
- Coordinates of the starting position for the menu.
- For `MENU_OBJECTPOPUP` requests where *hwndOwner* is an icon or tree view of a container which contains the object, this parameter is ignored, and the menu is displayed at the lower right-hand corner of the object's icon. This parameter is also ignored for `MENU_TITLEBARPULLDOWNxx` requests.
- ulMenuType (ULONG) - input
- Type of menu to display.
- Possible values are described in the following list:
- MENU_EDITPULLDOWN
- MENU_FOLDERMENUBAR
- MENU_FOLDERPULLDOWN
- MENU_HELPPULLDOWN
- MENU_NODISPLAY
- MENU_OBJECTPOPUP
- MENU_OPENVIEWPOPUP
- MENU_SELECTEDPULLDOWN
- MENU_TITLEBARPULLDOWN
- MENU_TITLEBARPULLDOWNINT
- MENU_USER
- MENU_VIEWPULLDOWN
- ulReserved (ULONG) - input
- Reserved value.
Returns
- hwndMenu (HWND) - returns
- Menu handle.
- A return value of **NULLHANDLE** indicates that either an invalid *ulMenuType* or an invalid *hwndClient* or *hwndOwner* was given.
How to Override
This method should not be overridden.
Usage
This method can be called at any time.
Example Code
#define INCL_WINWORKPLACE
#include <os2.h>
WPObject *somSelf; /* Pointer to the object on which the method is being invoked. */
HWND hwndOwner; /* Handle of the window that the menu is owned by. */
HWND hwndClient; /* Handle of the window on which the menu is displayed. */
POINTL *ptlPopupPt; /* Coordinates of the starting position for the menu. */
ULONG ulMenuType; /* Type of menu to display. */
ULONG ulReserved; /* Reserved value. */
HWND hwndMenu; /* Menu handle. */
hwndMenu = _wpDisplayMenu(somSelf, hwndOwner,
hwndClient, ptlPopupPt, ulMenuType,
ulReserved);