OleSetMenuDescriptor function (ole2.h)

Installs or removes OLE dispatching code from the container's frame window.


HRESULT OleSetMenuDescriptor(
  [in] HOLEMENU                 holemenu,
  [in] HWND                     hwndFrame,
  [in] HWND                     hwndActiveObject,
  [in] LPOLEINPLACEFRAME        lpFrame,


[in] holemenu

Handle to the composite menu descriptor returned by the OleCreateMenuDescriptor function. If NULL, the dispatching code is unhooked.

[in] hwndFrame

Handle to the container's frame window where the in-place composite menu is to be installed.

[in] hwndActiveObject

Handle to the object's in-place activation window. OLE dispatches menu messages and commands to this window.

[in] lpFrame

Pointer to the IOleInPlaceFrame interface on the container's frame window.

[in] lpActiveObj

Pointer to the IOleInPlaceActiveObject interface on the active in-place object.

Return value

This function returns S_OK on success.


The container should call OleSetMenuDescriptor to install the dispatching code on hwndFrame when the object calls the IOleInPlaceFrame::SetMenu method, or to remove the dispatching code by passing NULL as the value for holemenu to OleSetMenuDescriptor.

If both the lpFrame and lpActiveObj parameters are non-NULL, OLE installs the context-sensitive help F1 message filter for the application. Otherwise, the application must supply its own message filter.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ole2.h
Library Ole32.lib
DLL Ole32.dll
API set ext-ms-win-com-ole32-l1-1-5 (introduced in Windows 10, version 10.0.15063)

See also