Updated: July 19, 2016

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

The MQLocateEnd function ends a query, releasing the resources associated with the query.

  HANDLE hEnum    


[in] Query handle returned by a call to MQLocateBegin.


Indicates success.


The query handle specified in hEnum is not valid.

MQLocateEnd is not supported if there is no connection to the directory service. This restriction applies to dependent client computers, independent client computers (working offline), and Message Queuing routing servers (FRS). (For information on offline operations, see Message Queuing Offline Support.)

For information onSee
What information Message Queuing needs to locate queuesLocating Queues Using Function Calls
Structures used to set search criteriaSpecifying Search Criteria
Structures used to set returned queue propertiesSpecifying Queue Properties to Retrieve

The following code example is included in Using Message Queuing.

For an example ofSee
Locating queues based on queue labelC++ Code Example: Locating a Queue

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mq.h.

Library: Use Mqrt.lib.

Message Queuing Functions

Community Additions