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.
MQGetQueueProperties, MQGetQueueSecurity, MQInstanceToFormatName, MQPathNameToFormatName, MQSetQueueProperties