Retrieving or Peeking at a Specific Message
Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista
Message Queuing 3.0 provides API functions and COM methods for efficiently retrieving or peeking at a specific message based on its lookup identifier (PROPID_M_LOOKUPID and MSMQMessage.LookupId). The API function for peeking at or receiving a specific message is MQReceiveMessageByLookupId. The equivalent COM methods include:
•MSMQQueue.PeekFirstByLookupId
•MSMQQueue.PeekPreviousByLookupId
•MSMQQueue.ReceiveFirstByLookupId
•MSMQQueue.ReceiveLastByLookupId
•MSMQQueue.ReceiveNextByLookupId
•MSMQQueue.ReceivePreviousByLookupId. For more details, see Navigating with Lookup Identifiers.