Messenger.MsgWaitForMultipleObjects
Messenger
See also
Returns when an incoming message is available or one (or all) handles change their state to signaled.
[C++]
unsigned long MsgWaitForMultipleObjects(unsigned long nCount,
void* pHandles,
bool fWaitAll,
unsigned long dwMilliseconds);
[Pascal]
function MsgWaitForMultipleObjects(nCount : DWORD;
var pHandles;
fWaitAll : boolean;
dwMilliseconds : DWORD) : DWORD;
[VB6]
Sub MsgWaitForMultipleObjects(nCount As Long,
pHandles() As Long,
fWaitAll As Boolean,
dwMilliseconds As Long)
[ActiveX]
HRESULT _stdcall MsgWaitForMultipleObjects([in] unsigned long nCount, [in]
SAFEARRAY(long) pHandles,
[in] VARIANT_BOOL fWaitAll,
[in] unsigned long dwMilliseconds);
[C#]
public uint MsgWaitForMultipleObjects(uint nCount,
ref WaitHandle[] pHandles,
bool fWaitAll,
uint dwMilliseconds);
[VB.NET]
Public Function MsgWaitForMultipleObjects(ByVal nCount As Integer,
ByRef pHandles As WaitHandle(),
ByVal fWaitAll As Boolean,
ByVal dwMilliseconds As Integer) As UInt32
[Java]
not applicable;
[Java ME]
not applicable;
[Palm]
DWORD MsgWaitForMultipleObjects2(DWORD nCount, void* pHandles,
bool fWaitAll,
DWORD dwMilliseconds);
[DLL]
unsigned long __stdcall MCMessengerMsgWaitForMultipleObjects(HMCMessenger h,
unsigned long nCount,
HANDLE* pHandles,
bool fWaitAll,
unsigned long dwMilliseconds);
- [DLL]h - handle to the Messenger object that was returned by Create method
- nCount - the number of objects in pHandles array
- pHandles - an array of handles which are to be waited for. The number of elements in array is defined by nCount
- fWaitAll - Specifies whether Messenger should wait until all objects change their state or until at least one object changes it's state
- dwMilliseconds - Defines time to wait for the objects. If the time elapses the specified value, the method returns with result value set to TIMEOUT.
Set this parameter to INFINITE to wait infinitely.
The index of the object that has signalled in the array or MCE_TIMEOUT value if time has expired or MCE_FAILED if some object was destroyed. If the function was called not from the same thread in which Messenger operates, MCE_WRONGTHREAD code is returned.
This method returns when one of the following events happens:
- time specified by dwMilliseconds parameter is elapsed;
- there is an incoming message in the input queue;
- if fWaitAll is set, -- when all objects change their state to signaled;
- if fWaitAll is not set, -- when any of the objects changes it's state to singaled;
- if one of the objects is destroyed.
This method together with GetMessage, PeekMessage and MessageProcessed is an alternative to using Queues.
|