The MQHandleToFormatName function returns a format name for the queue based on its handle.
HRESULT APIENTRY MQHandleToFormatName(
QUEUEHANDLE hQueue,
LPWSTR lpwcsFormatName,
LPDWORD lpdwCount
);
On output, indicates the length of the returned format name string, including the null-terminating character. If the output value is greater than the initial input value, the supplied buffer is not large enough to contain the complete format name string and MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL is returned. In this case, only a portion of the format name is returned.
Format names are not stored by MSMQ; the format name is created when MQHandleToFormatName is called.
Typically, this function is used when you need a format name to specify a queue when calling MQGetQueueProperties, MQSetQueueProperties, MQGetQueueSecurity, or MQSetQueueSecurity.
Other format name translation functions include MQPathNameToFormatName and MQInstanceToFormatName.
Windows NT: Requires version 4.0 SP3 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mq.h.
Import Library: Use mqrt.lib.
Unicode: Defined only as Unicode.
MQGetQueueProperties, MQGetQueueSecurity, MQInstanceToFormatName, MQPathNameToFormatName, MQSetQueueProperties