как юзать функцию MsgWaitForMultipleObjects
nCount
Specifies the number of object handles in the array pointed to by pHandles. The maximum number of object handles is MAXIMUM_WAIT_OBJECTS minus one.
pHandles
Pointer to an array of object handles. For a list of the object types whose handles can be specified, see the following Remarks section. The array can contain handles of objects of different types.
Windows NT: The handles must have SYNCHRONIZE access. For more information, see Standard Access Rights.
особо интересуют эти два параметра