IShellBrowser::SetMenuSB method (shobjidl_core.h)

Installs the composite menu in the view window.

Syntax

HRESULT SetMenuSB(
  HMENU    hmenuShared,
  HOLEMENU holemenuRes,
  HWND     hwndActiveObject
);

Parameters

hmenuShared

Type: HMENU

A handle to the composite menu constructed by calls to IShellBrowser::InsertMenusSB and the InsertMenu function.

holemenuRes

Type: HOLEMENU

hwndActiveObject

Type: HWND

The view's window handle.

Return value

Type: RESULT

Returns S_OK if successful, or a COM-defined error value otherwise.

Remarks

This method is similar to the IOleInPlaceFrame::SetMenu method. However, Windows Explorer performs menu dispatch based on the menu item identifier.

The availability of specific menu items depends on whether the view has the focus. Accordingly, it is necessary to call the IShellBrowser::OnViewWindowActive method whenever the view window (or one of its child windows) has the focus.

Notes to Calling Applications

The object calls IShellBrowser_SetMenuSB to ask the container to install the composite menu structure set up by calls to IShellBrowser::InsertMenusSB.

Notes to Implementers

A container's implementation of this method should call the SetMenu function.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll (version 4.0 or later)

See also

IShellBrowser