IVsProfferCommands4.AddNamedCommand3 方法

定义

添加命名命令。

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

参数

pguidPackage
Guid

中包 GUID。 用于 null 加载项。

pguidCmdGroup
Guid

中要接收新命令的组的 GUID。 使用 vbapkg 中定义 GUID_Macro 或 GUID_AddIn。

pszCmdNameCanonical
String

中命令的完整名称。

pdwCmdId
UInt32

弄新命令的 ID。

pszCmdNameLocalized
String

中字符串的本地化版本。 可为 null

pszBtnText
String

中要在按钮上显示的文本。 null如果添加的命令不是按钮,则使用。

pszCmdTooltip
String

中要显示的工具提示文本。 可为 null

punkImage
Object

中图像。 这可以是 Bitmap 、和 Icon ,也可以是 IPicture。

dwCmdFlagsDefault
UInt32

中为默认值使用零 (0) ,使命令处于活动状态且可见。

cUIContexts
UInt32

中参数指向的上下文的数目 rgguidUIContexts

rgguidUIContexts
Guid[]

中用户界面上下文的 Guid 数组,指示用于显示命令的选项。 有关详细信息,请参阅的 UIContext_ 成员 VSConstants

dwUIElementType
UInt32

中枚举中的一个值 vsCommandControlType

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

适用于