The MQCloseCursor function closes a given cursor, allowing MSMQ to release the associated resources.
HRESULT APIENTRY MQCloseCursor( HANDLE hCursor );
Typically, cursors are closed by calling MQCloseCursor. However, MSMQ automatically closes any cursor created for a given queue when the queue is closed. MQCloseCursor returns MQ_ERROR_INVALID_HANDLE when an attempt is made to close a cursor that is already closed by MSMQ.
To create a cursor, call MQCreateCursor.
For an example of how cursors are used when reading messages, see Reading Messages in a Queue.
For examples of using MQCreateClose, see Reading Messages Using a Cursor.