Returns without removing (peeks) the first message available in the queue referenced by the MessageQueue.
[Visual Basic] Overloads Public Function BeginPeek() As IAsyncResult [C#] public IAsyncResult BeginPeek(); [C++] public: IAsyncResult* BeginPeek(); [JScript] public function BeginPeek() : IAsyncResult;
The IAsyncResult that identifies the asynchronous request posted.
BeginPeek is used in asynchronous processing to raise the System.Messaging.MessageQueue.MessageQueue.PeekCompleted event when a message is available. This overload does not specify a timeout, so System.Messaging.MessageQueue.PeekCompleted will only be raised when a message is received.
Because BeginPeek is asynchronous, you can use this method to peek the queue without blocking the current thread of execution. To peek the queue synchronously, use the Peek method.
MessageQueue Class | MessageQueue Members | System.Messaging Namespace | MessageQueue.BeginPeek Overload List | EndPeek | BeginReceive | Peek | Receive