I have a line of code that sets text to the clipboard:
Clipboard.SetDataObject(clipBoardExceptions);
When I try to set this data object to also persist after the application exits I get an error that the clipboard can't open:
Clipboard.SetDataObject(clipBoardExceptions, true);
Produces:
the second arg: {"OpenClipboard Failed (0x800401D0 (CLIPBRD_E_CANT_OPEN))"}
This exception was originally thrown at this call stack:
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(int, System.IntPtr)
in Marshal.cs System.Windows.Clipboard.Flush()
System.Windows.Clipboard.CriticalSetDataObject(object, bool)
System.Windows.Clipboard.SetDataObject(object, bool)