IVsProfferCommands4::AddNamedCommand2 Method (Guid, Guid, String^, UInt32, String^, String^, String^, String^, UInt32, UInt32, UInt32, UInt32, array<Guid>^, UInt32)

 

Adds a named command. This version has a parameter that specifies a UI element.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.10.0 (in Microsoft.VisualStudio.Shell.Interop.10.0.dll)

int AddNamedCommand2(
	[InAttribute] Guid% pguidPackage,
	[InAttribute] Guid% pguidCmdGroup,
	String^ pszCmdNameCanonical,
	[OutAttribute] unsigned int% pdwCmdId,
	String^ pszCmdNameLocalized,
	String^ pszBtnText,
	String^ pszCmdTooltip,
	String^ pszSatelliteDLL,
	unsigned int dwBitmapResourceId,
	unsigned int dwBitmapImageIndex,
	unsigned int dwCmdFlagsDefault,
	unsigned int cUIContexts,
	array<Guid>^ rgguidUIContexts,
	unsigned int dwUIElementType
)

Parameters

pguidPackage
Type: System::Guid

[in] The package GUID. Use null for addins.

pguidCmdGroup
Type: System::Guid

[in] The GUID for the group to receive the new command. Use GUID_Macro or GUID_AddIn defined in vbapkg.idl.

pszCmdNameCanonical
Type: System::String^

[in] The full name of the command.

pdwCmdId
Type: System::UInt32

[out] The ID for the new command.

pszCmdNameLocalized
Type: System::String^

[in] A localized version of the string. May be null.

pszBtnText
Type: System::String^

[in] The text to display on a button. Use null if the added command isn't a button.

pszCmdTooltip
Type: System::String^

[in] The ToolTip text to display. May be null.

pszSatelliteDLL
Type: System::String^

[in] The full path to a satellite DLL implementing the command. May be null.

dwBitmapResourceId
Type: System::UInt32

[in] The resource identifier for the icon to display for the command. Use zero (0) if there is no bitmap.

dwBitmapImageIndex
Type: System::UInt32

[in] The index of the bitmap within the bitmap file.

dwCmdFlagsDefault
Type: System::UInt32

[in] Use zero (0) for the default values to make the command active and visible.

cUIContexts
Type: System::UInt32

[in] The number of contexts pointed to by the rgguidUIContexts parameter.

rgguidUIContexts
Type: array<System::Guid>^

[in] An array of GUIDs for the user interface contexts indicating options for displaying the command. For more information, see the UIContext_ members of VSConstants.

dwUIElementType
Type: System::UInt32

[in] Integer. A value from the vsCommandControlType enumeration.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Return to top
Show: