IVsProfferCommands4.AddNamedCommand 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
添加命名命令。
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
参数
- 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。
- pszSatelliteDLL
- String
中实现命令的附属 DLL 的完整路径。 可为 null。
- dwBitmapResourceId
- UInt32
中要为命令显示的图标的资源标识符。 如果没有位图,则使用零 (0) 。
- dwBitmapImageIndex
- UInt32
中位图文件中位图的索引。
- dwCmdFlagsDefault
- UInt32
中为默认值使用零 (0) ,使命令处于活动状态且可见。
- cUIContexts
- UInt32
中参数指向的上下文的数目 rgguidUIContexts 。
- rgguidUIContexts
- Guid[]
中用户界面上下文的 Guid 数组,指示用于显示命令的选项。 有关详细信息,请参阅的 UIContext_ 成员 VSConstants 。
返回
如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。