This documentation is archived and is not being maintained.

IVsCommonMessagePump Interface

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

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

[GuidAttribute("FB3B20F4-9C8E-454A-984B-B1334F790541")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsCommonMessagePump

The IVsCommonMessagePump type exposes the following members.

  NameDescription
Public methodEnableRealProgressEnables (or disables) a percent-based progress control.
Public methodModalWaitForObjectsUse this method to wait for objects to signal (likely by some background processing) while keeping VS responsive.
Public methodModalWaitForObjectsWithClientThe 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.
Public methodSetAllowCancelSpecifies whether or not a Cancel button should appear n the wait dialog.
Public methodSetProgressInfoSpecifies the progress information for the wait dialog.
Public methodSetStatusBarTextSpecifies the text to use on the status bar.
Public methodSetTimeoutSpecifies the maximum time (in milliseconds) to wait for objects to signal.
Public methodSetWaitTextSpecifies the text for the default wait UI that explains the reason for the wait.
Public methodSetWaitTitleSpecifies the title of the wait dialog.
Top

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.

Show: