The MQDeleteQueue function deletes a queue from MQIS (in the case of public queues), or from the local computer (in the case of private queues).
HRESULT APIENTRY MQDeleteQueue( LPCWSTR lpwcsFormatName );
The format name of the queue (specified by lpwcsFormatName) cannot be a direct format name.
When deleting public queues, some clients may still see the queue registered in MQIS after the queue was deleted. Changes to MQIS (such as deleting a public queue) are propagated from site to site, which can cause delays in the availability of current information. Consequently, clients in some sites may still try to send messages to the queue, even though it was deleted. Propagation delays, including communication network delays such as down links, are controlled by the MSMQ Administrator.
Public queues cannot be deleted by independent client computers running offline. For information on offline operations, see MSMQ Offline Support.
For an example of using MQDeleteQueue, see Deleting a Queue.
MQCloseQueue, MQCreateQueue, MQOpenQueue, MQSetQueueSecurity