共用方式為


IVsCommonMessagePump Interface

Definition

Allows the user to keep Visual Studio responsive during background processing. The interface can be obtained via the SVsCommonMessagePumpFactory service.

public interface class IVsCommonMessagePump
public interface class IVsCommonMessagePump
__interface IVsCommonMessagePump
public interface IVsCommonMessagePump
[System.Runtime.InteropServices.Guid("FB3B20F4-9C8E-454A-984B-B1334F790541")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsCommonMessagePump
type IVsCommonMessagePump = interface
[<System.Runtime.InteropServices.Guid("FB3B20F4-9C8E-454A-984B-B1334F790541")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsCommonMessagePump = interface
Public Interface IVsCommonMessagePump
Derived
Attributes

Remarks

The interface provides a common way to keep Visual Studio responsive while doing long time processing on the main thread or waiting for objects (e.g. events, mutexes, semaphores, etc) to signal. Using this interface will not solve all the problems related to reentrancy that are caused by pumping window messages while doing some other processing on the main VS thread. It will allow for the uniform processing of windows messages and the correct handling of things like hotkeys. Using this interface allows troubleshooting mechanisms to detect reentrancy-related issues.

Methods

EnableRealProgress(Boolean)

Enables (or disables) a percent-based progress control.

ModalWaitForObjects(IntPtr[], UInt32, UInt32)

Use this method to wait for objects to signal (likely by some background processing) while keeping VS responsive.

ModalWaitForObjectsWithClient(IntPtr[], UInt32, IVsCommonMessagePumpClientEvents)

The method's behavior is very similar to ModalWaitForObjects(IntPtr[], UInt32, UInt32). In addition, it allows for a custom wait and events processing logic to be supplied. The method makes VS modal, and automatically provides the default wait UI after about 2 seconds of waiting.

SetAllowCancel(Boolean)

Specifies whether or not a Cancel button should appear n the wait dialog.

SetProgressInfo(Int32, Int32, String)

Specifies the progress information for the wait dialog.

SetStatusBarText(String)

Specifies the text to use on the status bar.

SetTimeout(UInt32)

Specifies the maximum time (in milliseconds) to wait for objects to signal.

SetWaitText(String)

Specifies the text for the default wait UI that explains the reason for the wait.

SetWaitTitle(String)

Specifies the title of the wait dialog.

Applies to