Επεξεργασία

Κοινή χρήση μέσω


IShellMenu::Initialize method (shobjidl_core.h)

Initializes a menu band.

Syntax

HRESULT Initialize(
  [in, optional] IShellMenuCallback *psmc,
  [in]           UINT               uId,
  [in]           UINT               uIdAncestor,
  [in]           DWORD              dwFlags
);

Parameters

[in, optional] psmc

Type: IShellMenuCallback*

A pointer to an IShellMenuCallback interface. This interface receives notifications from the menu. This value can be NULL.

[in] uId

Type: UINT

The identifier of the selected menu item. Set this parameter to -1 for the menu itself.

[in] uIdAncestor

Type: UINT

[in] dwFlags

Type: DWORD

Flags that control how the menu operates.

A combination of the following option values:

Value Meaning
SMINIT_DEFAULT
No options.
SMINIT_RESTRICT_DRAGDROP
Do not allow drag-and-drop.
SMINIT_TOPLEVEL
This is the top band.
SMINIT_CACHED
Do not destroy the band when the window is closed.
 

In addition to the values above, one of the following layout options:

Value Meaning
SMINIT_VERTICAL
Specifies a vertical band.
SMINIT_HORIZONTAL
Specifies a horizontal band.

Return value

Type: HRESULT

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

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll