Obtaining Format Names
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 provides several ways to obtain the format names of queues.
When Creating Queues
When creating queues, Message Queuing returns a format name whenever it creates a destination queue.
Applications using COM components can obtain the format name of a destination queue from the MSMQQueueInfo object used to create the queue.
When Locating Public Queues
Applications using API functions can retrieve the path name or queue identifier (GUID) of a public queue and translate these elements into a format name for the queue by using the MQPathNameToFormatName and MQInstanceToFormatName functions, respectively.
Applications using COM components can obtain the format name of a queue from the collection of MSMQQueueInfo objects referenced by the MSMQQueueInfos object returned by a query.
From a Returned Queue Handle
Applications using API functions can translate the queue handle returned by MQOpenQueue to a format name by using the MQHandleToFormatName function.
Applications using COM components can obtain the format name of the queue from the MSMQQueueInfo.FormatName property of the MSMQQueueInfo object used to open the queue.
From an ADs Path
Applications using API functions can translate the ADs path of a queue, queue alias, or distribution list to a format name by using the MQADsPathToFormatName function.
Applications using COM components can obtain the format name of a distribution list, queue alias, or single public queue from the MSMQDestination.FormatName property of an MSMQDestination object initialized by setting its MSMQDestination.ADsPath property.
From Message Properties
Applications can retrieve the format names of response queues, administration queues, and destination queues by retrieving the appropriate property of the message. Message Queuing Glossary
The following message properties hold the format names of queues:
Response queue properties: These properties are set by the sending application when requesting response messages (or to send the format name of a private queue) and are set by Message Queuing when returning acknowledgment messages. In acknowledgment messages, these properties hold the format name of the original destination queue.
For details about these properties see:
PROPID_M_RESP_QUEUE (MSMQ 1.0 and MSMQ 2.0 only)
PROPID_M_RESP_FORMAT_NAME (introduced in MSMQ 3.0)
MSMQMessage.ResponseQueueInfo (MSMQ 1.0 and MSMQ 2.0 only)
MSMQMessage.ResponseDestination (introduced in MSMQ 3.0)
Administration queue properties: These properties are set by the sending application when requesting acknowledgment messages.
For details about these properties see:
Destination queue properties: These properties are set by Message Queuing when the message is sent. If a message is sent to multiple destination queues both properties are set.
For details about these properties see:
PROPID_M_DEST_FORMAT_NAME (introduced in MSMQ 3.0)
MSMQMessage.DestinationQueueInfo
MSMQMessage.Destination (introduced in MSMQ 3.0)