OleSetMenuDescriptor  WI7GST

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

WINOLEAPI OleSetMenuDescriptor(

    HOLEMENU holemenu,

//Handle to the composite menu descriptor

    HWND hwndFrame,

//Handle to the container s frame window

    HWND hwndActiveObject,

//Handle to the object s in-place activation window

    LPOLEINPLACEFRAME lpFrame,

//Pointer to the container s frame window

    LPOLEINPLACEACTIVEOBJECT lpActiveObj

//Active in-place object

   );

 

 

Parameters

holemenu

[in] Handle to the composite menu descriptor returned by the OleCreateMenuDescriptorH8K.4H function. If NULL, the dispatching code is unhooked.

hwndFrame

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

hwndActiveObject

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

lpFrame

[in] Pointer to the IOleInPlaceFrame interface on the container s frame window.

lpActiveObj

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

 

Return Values

This function supports the standard return values E_FAIL, E_INVALIDARG and E_UNEXPECTED, as well as the following:

S_OK

The menu was installed correctly.

 

Remarks

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.

See Also

OleCreateMenuDescriptor, IOleInPlaceFrame::SetMenu, IOleInPlaceActiveObject