OleFlushClipboard
Carries out
the clipboard shutdown sequence. It also releases the IDataObject
pointer that was placed on the clipboard by the OleSetClipboard
WINOLEAPI
OleFlushClipboard();
Return Values
S_OK
The clipboard
has been flushed.
CLIPBRD_E_CANT_OPEN
The Windows OpenClipboard
function used within OleFlushClipboard failed.
CLIPBRD_E_CANT_CLOSE
The Windows CloseClipboard
function used within OleFlushClipboard failed.
Remarks
OleFlushClipboard renders the data from a data object onto the
clipboard and releases the IDataObject
Before
calling OleFlushClipboard, you can easily determine if your data is
still on the clipboard with a call to the OleIsCurrentClipboard
OleFlushClipboard leaves all formats offered by the data transfer
object, including the OLE 1 compatibility formats, on the clipboard so they are
available after application shutdown. In addition to OLE 1 compatibility
formats, these include all formats offered on a global handle medium (all
except for TYMED_FILE) and formatted with a NULL target device. For example, if
a data-source application offers a particular clipboard format (say cfFOO) on
an IStorage object, and calls the OleFlushClipboard
To retrieve
the information on the clipboard, you can call the OleGetClipboard
function from another application, which creates a default data object, and the
hglobal from the clipboard again becomes a storage object. Furthermore,
the FORMATETC31KJZ6I method would all correctly indicate that
the original clipboard format (cfFOO) is again available on a TYMED_ISTORAGE.
To empty the
clipboard, call the OleSetClipboard
See Also