IVsCommonMessagePump.ModalWaitForObjects Method (IntPtr[], UInt32, UInt32)

 

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

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

int ModalWaitForObjects(
	IntPtr[] rgHandles,
	uint cHandles,
	out uint pdwWaitResult
)

Parameters

rgHandles
Type: System.IntPtr[]

The array containing the handles of the objects to wait on.

cHandles
Type: System.UInt32

The number of handles in the array. The maximum is 64.

pdwWaitResult
Type: System.UInt32

[out] The result that is set when the wait condition was met (i.e., when the method returned S_OK):

  1. WAIT_OBJECT_0 to (WAIT_OBJECT_0 + cHandles - 1) indicates the signaled object (applies only when fWaitForAllObjects is false).

  2. WAIT_OBJECT_0 if fWaitForAllObjects was true.

  3. WAIT_TIMEOUT the time-out interval elapsed before the condition specified by fWaitForAllObjects was met.

Return Value

Type: System.Int32

S_OK if the wait condition was met; the pdwWaitResult parameter will contain more information about the wait result. Returns E_PENDING if the method had to quit because the user cancelled the wait operation. E_ABORTif WM_QUIT was received.

This is the preferred method to use in this interface. It does not require the consumer to implement anything. The method automatically puts the IDE in a modal state, which reduces the risk of reentrancy. The method also handles displays the default UI that explains the reason for the wait. This wait UI is shown roughly 2 seconds after the wait has been initiated.

Return to top
Show: