interface ICoreWebView2ContextMenuTarget

interface ICoreWebView2ContextMenuTarget
  : public IUnknown

Represents the information regarding the context menu target.

Summary

Members Descriptions
get_FrameUri Gets the uri of the frame.
get_HasLinkText Returns TRUE if the context menu is requested on text element that contains an anchor tag.
get_HasLinkUri Returns TRUE if the context menu is requested on HTML containing an anchor tag.
get_HasSelection Returns TRUE if the context menu is requested on a selection.
get_HasSourceUri Returns TRUE if the context menu is requested on HTML containing a source uri.
get_IsEditable Returns TRUE if the context menu is requested on an editable component.
get_IsRequestedForMainFrame Returns TRUE if the context menu was requested on the main frame and FALSE if invoked on another frame.
get_Kind Gets the kind of context that the user selected.
get_LinkText Gets the text of the link (if HasLinkText is TRUE, null otherwise).
get_LinkUri Gets the uri of the link (if HasLinkUri is TRUE, null otherwise).
get_PageUri Gets the uri of the page.
get_SelectionText Gets the selected text (if HasSelection is TRUE, null otherwise).
get_SourceUri Gets the active source uri of element (if HasSourceUri is TRUE, null otherwise).

Includes the context selected and the appropriate data used for the actions of a context menu.

Applies to

Product Introduced
WebView2 Win32 1.0.1185.39
WebView2 Win32 Prerelease 1.0.1189

Members

get_FrameUri

Gets the uri of the frame.

public HRESULT get_FrameUri(LPWSTR * value)

Will match the PageUri if IsRequestedForMainFrame is TRUE.

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_HasLinkText

Returns TRUE if the context menu is requested on text element that contains an anchor tag.

public HRESULT get_HasLinkText(BOOL * value)

get_HasLinkUri

Returns TRUE if the context menu is requested on HTML containing an anchor tag.

public HRESULT get_HasLinkUri(BOOL * value)

get_HasSelection

Returns TRUE if the context menu is requested on a selection.

public HRESULT get_HasSelection(BOOL * value)

get_HasSourceUri

Returns TRUE if the context menu is requested on HTML containing a source uri.

public HRESULT get_HasSourceUri(BOOL * value)

get_IsEditable

Returns TRUE if the context menu is requested on an editable component.

public HRESULT get_IsEditable(BOOL * value)

get_IsRequestedForMainFrame

Returns TRUE if the context menu was requested on the main frame and FALSE if invoked on another frame.

public HRESULT get_IsRequestedForMainFrame(BOOL * value)

get_Kind

Gets the kind of context that the user selected.

public HRESULT get_Kind(COREWEBVIEW2_CONTEXT_MENU_TARGET_KIND * value)

get_LinkText

Gets the text of the link (if HasLinkText is TRUE, null otherwise).

public HRESULT get_LinkText(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_LinkUri

Gets the uri of the link (if HasLinkUri is TRUE, null otherwise).

public HRESULT get_LinkUri(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_PageUri

Gets the uri of the page.

public HRESULT get_PageUri(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_SelectionText

Gets the selected text (if HasSelection is TRUE, null otherwise).

public HRESULT get_SelectionText(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.

get_SourceUri

Gets the active source uri of element (if HasSourceUri is TRUE, null otherwise).

public HRESULT get_SourceUri(LPWSTR * value)

The caller must free the returned string with CoTaskMemFree. See API Conventions.