Compartilhar via


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)

Syntax

'Declaration
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
)
int OnUIEventProgress(
    [InAttribute] [OutAttribute] unsigned int% pdwCookie, 
    [InAttribute] int fInProgress, 
    [InAttribute] String^ pwszLabel, 
    [InAttribute] unsigned int nComplete, 
    [InAttribute] unsigned int nTotal
)
abstract OnUIEventProgress : 
        pdwCookie:uint32 byref * 
        fInProgress:int * 
        pwszLabel:string * 
        nComplete:uint32 * 
        nTotal:uint32 -> int
function OnUIEventProgress(
    pdwCookie : uint, 
    fInProgress : int, 
    pwszLabel : String, 
    nComplete : uint, 
    nTotal : uint
) : int

Parameters

  • pdwCookie
    Type: 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.

  • fInProgress
    Type: Int32

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

  • pwszLabel
    Type: 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.

  • nComplete
    Type: UInt32

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

  • nTotal
    Type: UInt32

    [in] Specifies the total duration of the operation.

Return Value

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

Remarks

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.

.NET Framework Security

See Also

Reference

IOleComponentUIManager Interface

Microsoft.VisualStudio.Shell.Interop Namespace