다음을 통해 공유


IVsProfferCommands4.AddNamedCommand3 Method

Definition

Adds a named command.

public:
 int AddNamedCommand3(Guid % pguidPackage, Guid % pguidCmdGroup, System::String ^ pszCmdNameCanonical, [Runtime::InteropServices::Out] System::UInt32 % pdwCmdId, System::String ^ pszCmdNameLocalized, System::String ^ pszBtnText, System::String ^ pszCmdTooltip, System::Object ^ punkImage, System::UInt32 dwCmdFlagsDefault, System::UInt32 cUIContexts, cli::array <Guid> ^ rgguidUIContexts, System::UInt32 dwUIElementType);
public int AddNamedCommand3 (ref Guid pguidPackage, ref Guid pguidCmdGroup, string pszCmdNameCanonical, out uint pdwCmdId, string pszCmdNameLocalized, string pszBtnText, string pszCmdTooltip, object punkImage, uint dwCmdFlagsDefault, uint cUIContexts, Guid[] rgguidUIContexts, uint dwUIElementType);
abstract member AddNamedCommand3 : Guid * Guid * string * uint32 * string * string * string * obj * uint32 * uint32 * Guid[] * uint32 -> int
Public Function AddNamedCommand3 (ByRef pguidPackage As Guid, ByRef pguidCmdGroup As Guid, pszCmdNameCanonical As String, ByRef pdwCmdId As UInteger, pszCmdNameLocalized As String, pszBtnText As String, pszCmdTooltip As String, punkImage As Object, dwCmdFlagsDefault As UInteger, cUIContexts As UInteger, rgguidUIContexts As Guid(), dwUIElementType As UInteger) 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

[out] The 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.

punkImage
Object

[in] The image. This can be a Bitmap, and Icon, or an IPicture.

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.

dwUIElementType
UInt32

[in] A value from the vsCommandControlType enumeration.

Returns

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

Applies to