The IClipboard::Cursor class is a nested class used to iterate through the available formats of data in the clipboard. Unlike many other cursor classes, IClipboard::Cursor only supports movement in a forward direction. When you use a cursor loop like the one in the following example, the clipboard formats are returned in the same order that they were added.
// Iterate over clipboard formats... IClipboard clipboard(frameWindowHandle); IClipboard::Cursor(clipboard); for ( cursor.setToFirst(); cursor.isValid(); cursor.setToNext() ) { // Do something with each format cout << "The format is: " << clipboard.format(cursor); }
Use these members to construct and destruct IClipboard::Cursor objects. You cannot copy or assign IClipboard::Cursor objects because the copy constructor and assignment operator are private.
![]() |
public:
virtual ~Cursor()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
Cursor(IClipboard& clipboard)
You can construct objects of this class from a reference to an IClipboard object.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
You use the cursor movement members to position the clipboard cursor.
![]() |
public:
virtual bool setToFirst()
Positions the cursor on the first format in the clipboard. Returns true if the cursor points to a valid format.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool setToNext()
Positions the cursor on the next format in the clipboard. If you call setToNext before calling setToFirst, it positions the cursor on the first format in the clipboard. Returns true if the cursor points to a valid format.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use the cursor validation members to determine if the clipboard cursor is valid or to indicate that it is no longer valid.
![]() |
public:
virtual void invalidate()
Puts the cursor in an invalid state.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool isValid() const
If the cursor is valid, returns true.
Windows | OS/2 | AIX |
Yes | Yes | Yes |