IVsStatusbar.Progress(UInt32, Int32, String, UInt32, UInt32) 方法

定义

显示执行时间确定性的操作的进度。

public:
 int Progress([Runtime::InteropServices::Out] System::UInt32 % pdwCookie, int fInProgress, System::String ^ pwszLabel, System::UInt32 nComplete, System::UInt32 nTotal);
int Progress([Runtime::InteropServices::Out] unsigned int & pdwCookie, int fInProgress, std::wstring const & pwszLabel, unsigned int nComplete, unsigned int nTotal);
public int Progress (out uint pdwCookie, int fInProgress, string pwszLabel, uint nComplete, uint nTotal);
abstract member Progress : uint32 * int * string * uint32 * uint32 -> int
Public Function Progress (ByRef pdwCookie As UInteger, fInProgress As Integer, pwszLabel As String, nComplete As UInteger, nTotal As UInteger) As Integer

参数

pdwCookie
UInt32

[in,out]当前用户的 ID,以防止同时使用进度栏。

fInProgress
Int32

[in] true 正在使用进度栏;完成时为 false。

pwszLabel
String

中正在使用进度栏时显示在 "状态" 字段中的文本。

nComplete
UInt32

中进度栏中当前完成的单位数。

nTotal
UInt32

中进度栏操作的总单位数。

返回

Int32

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

注解

COM 签名

从 vsshell:

HRESULT IVsStatusbar::Progress(  
   [in,out]VSCOOKIE *pdwCookie,  
   [in]BOOL fInProgress,  
   [in]LPCOLESTR pwszLabel,  
   [in]ULONG nComplete,  
   [in]ULONG nTotal  
);  

进度在状态栏的进度栏区域中显示为一个不断增长的蓝条。 状态栏用户第一次调用此方法时, pdwCookie 必须设置为零。 返回的值是在 pdwCookie 以后调用此方法时状态栏用户必须使用的唯一 ID。

调用此方法以显示操作过程中进行的进度量。 因此,在 nTotal 调用此方法之前,必须知道。 如果 nTotal 无法提前已确定并且操作预计需要几秒钟以上,请改为调用 Animation 方法。

适用于