Cursor Behavior when Peeking at Messages
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
If the receiving application is peeking at the current message (the message is not removed from the queue), the cursor remains pointing at the current message location and the application must move the cursor.
Calls to Peek at Messages and Move the Cursor
The following illustration shows the function and COM method calls used to peek at the current message and then move the cursor to the next message. Note that in this illustration, the first call moves the cursor to the first message location in the queue and peeks at the message at that location, then all subsequent calls move the cursor to the next message location until the cursor is at the end of the queue.
Reaching the End of the Queue
When the cursor reaches the end of the queue, it waits for a new message to arrive or a time-out to occur. If a new message arrives the cursor is always moved to the new messages, regardless of where the message is placed in the queue. Typically messages are inserted at the end of the queue, however, messages can be placed anywhere within the queue depending on their priority level.
For information on | See |
---|---|
How a cursor is moved to the first message when the cursor is created. | Cursor Behavior when Creating a Cursor |
How the cursor is moved when retrieving messages | Cursor Behavior when Retrieving Messages |
How the cursor is moved when reaching the end of the queue | Cursor Behavior when Reaching the End of the Queue |
How multiple cursors interact | Cursor Behavior when Using Multiple Cursors |
How the cursor behaves when waiting for new messages at the end of the queue. | Cursor Behavior when Waiting for New Messages |
How the cursor behaves when trying to read a message that was removed by someone else. | Cursor Behavior When Messages are Not Available |
How the behaves when errors occur. | Cursor Behavior Due to Errors |
How the cursor behaves when trying to read messages from a deleted queue | Cursor Behavior and Deleted Queues |
How the cursor moves when the queue contains messages with different message priority levels. | Cursor Behavior and Message Priority |
Summary of COM methods that use cursors for synchronous and asynchronous operations | Cursors and COM Components |
Example code that navigates a queue based on cursors. | Navigating Queue Examples |