The MQDeleteQueue function deletes a queue from Active Directory (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 a public queue, some clients may still see the queue registered in Active Directory after the queue has been deleted. A change to Active Directory (such as deleting a public queue) is propagated from domain controller to domain controller, which can cause delays in the availability of new information. Consequently, clients using a specific domain controller 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 if there is no connection to Active Directory. This restriction applies to dependent client computers, independent client computers that are working offline, and MSMQ routing servers (FRS). (For information on offline operations, see MSMQ Offline Support.)
For an example of using MQDeleteQueue, see Deleting a Queue.
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.
MQCloseQueue, MQCreateQueue, MQOpenQueue, MQSetQueueSecurity