I want to get a list of all data from the clipboard history but I can't find an enumerator method. Would there be something I'm missing or what other way can I do it? I can't find an enumerator method in the clipboard class.
var clip = Clipboard.GetDataObject();
foreach (var item in clip)
{
MessageBox.Show(item);
}
I was able to get clipboard history by referencing the Clipboard class from WinRT API onto my WPF application.
I also had to set my target framework to .NET 5.0 with a TFM version and didn't need any NuGet packages for this to work. You will need the Microsoft.Windows.SDK.Contracts NuGet Package on earlier versions of .NET.