INameSpaceTreeControlEvents::OnAfterContextMenu method (shobjidl.h)

Called after a context menu is displayed.

Syntax

HRESULT OnAfterContextMenu(
  [in, optional] IShellItem   *psi,
  [in]           IContextMenu *pcmIn,
  [in]           REFIID       riid,
  [out]          void         **ppv
);

Parameters

[in, optional] psi

Type: IShellItem*

A pointer to the IShellItem from which the context menu is generated. This value can be NULL only if the NSTCS2_SHOWNULLSPACEMENU flag is set.

[in] pcmIn

Type: IContextMenu*

A pointer to the context menu.

[in] riid

Type: REFIID

Reference to the IID of the context menu.

[out] ppv

Type: void**

When this method returns, contains the address of a pointer to the interface specified in riid.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method allows client to completely replace the context menu. This method will allow the client to use the context menu returned by ppv and not necessarily the one specified in pcmIn.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl.h

See also

INameSpaceTreeControlEvents

NSTCSTYLE2