Partilhar via


MQCloseCursor

 

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 MQCloseCursor function closes a specific cursor, allowing Message Queuing to release the associated resources.

HRESULT APIENTRY MQCloseCursor(  
  HANDLE hCursor    
);  

Parameters

hCursor

[in] Handle to the cursor you want to close.

Return Values

MQ_OK

Indicates success.

MQ_ERROR_INVALID_HANDLE (0xC00E0007)

The cursor handle specified in hCursor is not valid.

Remarks

Cursors are closed by calling MQCloseCursor. Message Queuing does not automatically close cursors created for a given queue when that queue is closed with MQCloseQueue.

For information on how cursors behave when navigating queues, see Navigating with Cursors.

Example Code

The following code examples are included in Using Message Queuing.

For an example of See
Peeking at each message in a queue using cursors C/C++ Code Example: Navigating Using Cursors
Filtering specific messages using cursors C/C++ Code Example: Application-Specific Filters

 C/C++ Code Example: Correlation Identifier Filters

 C/C++ Code Example: Time Sent Filters

Requirements

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.

See Also

Message Queuing Functions
MQCreateCursor