Desktop Functions: Smart Device Functions:
|
WaitForMultipleObjects (coredll)
coredll is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for WaitForMultipleObjects in other DLLs exists, click on Find References to the right. C# Signature:
[DllImport("coredll.dll", EntryPoint = "WaitForMultipleObjects", SetLastError = true)] VB Signature:
Declare Function WaitForMultipleObjects Lib "coredll.dll" (ByVal nCount As Integer, ByVal lpHandles() As IntPtr, ByVal fWaitAll As Boolean, ByVal dwMilliseconds As Integer) As Integer User-Defined Types:None. Alternative Managed API:Do you know one? Please contribute it! Notes:Parameters:nCount: Specifies the number of object handles in the array pointed to by lpHandles. The maximum number of object handles is MAXIMUM_WAIT_OBJECTS. lpHandles: Pointer to an array of object handles. For a list of the object types whose handles can be specified, see the Remarks section. The array can contain handles of objects of different types. fWaitAll: Specifies the wait type. This parameter must be set to FALSE. This causes function to return when the state of any one of the objects set to is signaled. The return value indicates the object whose state caused the function to return. dwMilliseconds: Specifies the time-out interval in milliseconds. The function returns if the interval elapses, even if the conditions specified by the bWaitAll parameter are not met. If dwMilliseconds is zero, the function tests the states of the specified objects and returns immediately. If dwMilliseconds is INFINITE, the function's time-out interval never elapses. Return Value:If the function succeeds, the return value indicates the event that caused the function to return. The following table shows possible values. WAIT_OBJECT_0 to (WAIT_OBJECT_0 + nCount –1): the return value minus WAIT_OBJECT_0 indicates the lpHandles array index of the object that satisfied the wait. If more than one object became signaled during the call, this is the array index of the signaled object with the smallest index value of all the signaled objects. WAIT_TIMEOUT : the time-out interval elapsed and the condition specified by the fWaitAll parameter is not satisfied. WAIT_FAILED indicates failure. To get extended error information, call GetLastError. Tips & Tricks:The Handle property of .NET EventWaitHandle objects are pseudo-handles, and cannot be used with this P/Invoke function. You can only use handles obtained from the CreateEvent P/Invoke function. Please add some! Sample Code:
IntPtr hNamedEvent1 = CreateEvent(IntPtr.Zero, false, false, "namedEvent1"); Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|