Filter: C++  Pascal  C#  VB.NET  Java  Java ME  ActiveX  DLL 


Messenger     See also    

Returns when an incoming message is available or one (or all) handles change their state to signaled.


    unsigned long MsgWaitForMultipleObjects(unsigned long nCount, void* pHandles, bool fWaitAll, unsigned long dwMilliseconds);

    function MsgWaitForMultipleObjects(nCount : DWORD; var pHandles; fWaitAll : boolean; dwMilliseconds : DWORD) : DWORD;

    Sub MsgWaitForMultipleObjects(nCount As Long, pHandles() As Long, fWaitAll As Boolean, dwMilliseconds As Long)

     HRESULT _stdcall MsgWaitForMultipleObjects([in] unsigned long nCount, [in] SAFEARRAY(long) pHandles, [in] VARIANT_BOOL fWaitAll, [in] unsigned long dwMilliseconds);

    public uint MsgWaitForMultipleObjects(uint nCount, ref WaitHandle[] pHandles, bool fWaitAll, uint dwMilliseconds);

    Public Function MsgWaitForMultipleObjects(ByVal nCount As Integer, ByRef pHandles As WaitHandle(), ByVal fWaitAll As Boolean, ByVal dwMilliseconds As Integer) As UInt32

    not applicable;

[Java ME]
    not applicable;

    unsigned long __stdcall IPCMessengerMsgWaitForMultipleObjects(HIPCMessenger 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 its 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.

Return value

    The index of the object that has signalled in the array or IPCE_TIMEOUT value if time has expired or IPCE_FAILED if some object was destroyed.


    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 its state to Signaled;
  • if one of the objects is destroyed.
    This method together with GetMessage, PeekMessage and MessageProcessed is an alternative to using Queues.

See also:     Queue class     IPCMessage structure     GetMessage     PeekMessage     MessageProcessed