Compartilhar via


IVsProfferCommands3.AddNamedCommand Method

Definition

Adds a named command.

public:
 int AddNamedCommand(Guid % pguidPackage, Guid % pguidCmdGroup, System::String ^ pszCmdNameCanonical, [Runtime::InteropServices::Out] System::UInt32 % pdwCmdId, System::String ^ pszCmdNameLocalized, System::String ^ pszBtnText, System::String ^ pszCmdTooltip, System::String ^ pszSatelliteDLL, System::UInt32 dwBitmapResourceId, System::UInt32 dwBitmapImageIndex, System::UInt32 dwCmdFlagsDefault, System::UInt32 cUIContexts, cli::array <Guid> ^ rgguidUIContexts);
public int AddNamedCommand (ref Guid pguidPackage, ref Guid pguidCmdGroup, string pszCmdNameCanonical, out uint pdwCmdId, string pszCmdNameLocalized, string pszBtnText, string pszCmdTooltip, string pszSatelliteDLL, uint dwBitmapResourceId, uint dwBitmapImageIndex, uint dwCmdFlagsDefault, uint cUIContexts, Guid[] rgguidUIContexts);
abstract member AddNamedCommand : Guid * Guid * string * uint32 * string * string * string * string * uint32 * uint32 * uint32 * uint32 * Guid[] -> int
Public Function AddNamedCommand (ByRef pguidPackage As Guid, ByRef pguidCmdGroup As Guid, pszCmdNameCanonical As String, ByRef pdwCmdId As UInteger, pszCmdNameLocalized As String, pszBtnText As String, pszCmdTooltip As String, pszSatelliteDLL As String, dwBitmapResourceId As UInteger, dwBitmapImageIndex As UInteger, dwCmdFlagsDefault As UInteger, cUIContexts As UInteger, rgguidUIContexts As Guid()) As Integer

Parameters

pguidPackage
Guid

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

pguidCmdGroup
Guid

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

pszCmdNameCanonical
String

[in] The full name of the command.

pdwCmdId
UInt32

[outThe ID for the new command.

pszCmdNameLocalized
String

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

pszBtnText
String

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

pszCmdTooltip
String

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

pszSatelliteDLL
String

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

dwBitmapResourceId
UInt32

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

dwBitmapImageIndex
UInt32

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

dwCmdFlagsDefault
UInt32

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

cUIContexts
UInt32

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

rgguidUIContexts
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.

Returns

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

Applies to