IOleComponentUIManager.OnUIEventProgress Method

Requests the display of a progress indicator during a long-term operation.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int OnUIEventProgress(
	out uint pdwCookie,
	int fInProgress,
	string pwszLabel,
	uint nComplete,
	uint nTotal


Type: System.UInt32

[in] Identifies a progress indicator. Setting pdwCookie to zero indicates that the SOleComponentUIManager service should start a new progress indicator. If pdwCookie is not set to zero, the service should display the current progress indicator.

Type: System.Int32

[in] Set to true to start or continue display of a progress indicator and false to cancel the progress display.

Type: System.String

[in] Points to the label that explains the purpose of the progress indicator. If pswzLabel is set to null on subsequent calls to update the progress of an on-going progress indicator, the previous value of the label is used.

Type: System.UInt32

[in] Specifies the time that has already passed for the operation.

Type: System.UInt32

[in] Specifies the total duration of the operation.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From oleipc.idl:

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

To start a new progress indicator, a VSPackage object calls OnUIEventProgress, setting pdwCookie to null and fInProgress to TRUE. The SOleComponentUIManager service returns a value to identify the particular progress indicator. The VSPackage object must use this value on all subsequent calls to update the progress indicator state. The VSPackage object calls OnUIEventProgress with fInProgress set to false to discontinue the progress indicator.

The SOleComponentUIManager service controls whether or not multiple progress indicators can be running simultaneously. Typically pdwCookie is set to 1 to indicate that only one progress indicator at a time is allowed.