Help Center

CRichEditOleCallback.GetContextMenumethod

Queries the application for a context menu to use on a right-click event.

Windowsmethoddocumented

Syntax

FUNCTION GetContextMenu (BYVAL seltype AS WORD, BYVAL lpoleobj AS LPOLEOBJECT, BYVAL lpchrg AS CHARRANGE PTR, BYVAL lphmenu AS HMENU PTR) AS HRESULT

Parameters

NameDescription
seltypeSelection type. The value, which specifies the contents of the new selection, can be one or more of the following values.
SEL_EMPTY. The selection is empty.
SEL_TEXT. Text.
SEL_OBJECT. At least one COM object.
SEL_MULTICHAR. More than one character of text.
SEL_MULTIOBJECT. More than one COM object.
GCM_RIGHTMOUSEDROP. Indicates that a context menu for a right-mouse drag drop should be generated. The lpoleobj parameter is a pointer to the IDataObject interface for the object being dropped.
lpoleobjPointer to an interface. If the seltype parameter includes the SEL_OBJECT flag, lpoleobj is a pointer to the IOleObject interface for the first selected COM object. If seltype includes the GCM_RIGHTMOUSEDROP flag, lpoleobj is a pointer to an IDataObject interface. Otherwise, lpoleobj is NULL. If you hold on to the interface pointer, you must call the AddRef method to increment the object's reference count.
lpchrgPointer to a CHARRANGE structure containing the current selection.
lphmenuThe handle of a context menu to use. This parameter is ignored if an error is returned. A rich edit control destroys the menu when it is finished with it so the client should not.

Description

Queries the application for a context menu to use on a right-click event.

Returns S_OK on success. If the method fails, it can return the following value.

Reference

  • Defined in AfxNova/CRichEditOleCallback.inc:40
  • Documented in Windows/WIndows Controls/RichEdit/CRichEditOleCallback Class.md
  • Topic: CRichEditOleCallback Class