IOleComponentUIManager.OnUIEventProgress 方法

在长期操作时请求进度指示器的显示。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function OnUIEventProgress ( _
    <OutAttribute> ByRef pdwCookie As UInteger, _
    fInProgress As Integer, _
    pwszLabel As String, _
    nComplete As UInteger, _
    nTotal As UInteger _
) As Integer
int OnUIEventProgress(
    out uint pdwCookie,
    int fInProgress,
    string pwszLabel,
    uint nComplete,
    uint nTotal
)

参数

  • pdwCookie
    类型:System.UInt32%
    [in] 标识进度指示器。设置 pdwCookie 零指示 SOleComponentUIManager 服务应开始新的进度指示器。如果 pdwCookie 未设置为零,该服务应显示当前进度指示器。
  • fInProgress
    类型:System.Int32
    [in] 设置为 true 启动或继续进度指示器和 false 的显示取消正在进行显示。
  • pwszLabel
    类型:System.String
    [in] 指向解释进度指示器的目的标签。如果 pswzLabel 在设置为 null 的后续调用继续更新的进度指示器的进度,标签以前的值。
  • nComplete
    类型:System.UInt32
    [in] 指定用于操作已通过的时间。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 oleipc.idl:

HRESULT IOleComponentUIManager::OnUIEventProgress(
   [in][out] DWORD_PTR *pdwCookie,
   [in] BOOL fInProgress,
   [in] LPOLESTR pwszLabel,
   [in] ULONG nComplete,
   [in] ULONG nTotal
);

若要开始新的进度指示器, VSPackage 对象调用 OnUIEventProgress,设置 pdwCookie null 和 fInProgress 为 true。SOleComponentUIManager 服务返回值标识特定进度指示器。对象必须使用在所有的该值的 VSPackage 的后续调用更新的进度显示状态。VSPackage 对象调用 OnUIEventProgress 和 fInProgress 设置为 false 中断进度指示器。

SOleComponentUIManager 服务控件的多个进度指示器是否可同时运行。通常 pdwCookie 设置为 1 指示只有一个进度显示每个允许的。

.NET Framework 安全性

请参见

参考

IOleComponentUIManager 接口

Microsoft.VisualStudio.Shell.Interop 命名空间