且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从剪贴板清除指定的格式数据?

更新时间:2022-03-18 14:54:22

剪贴簿只保存一个 IDataObject ;此数据对象可以呈现多种数据格式,但它只是一个COM对象。做你想做的事情的唯一方法是复制现有的数据对象(减去你希望删除的格式),并将其设置为剪贴板,而不是原来的。

The clipboard only holds a single IDataObject at one time; this data object can present multiple data formats but it is just a single COM object. The only way to do what you want would be to duplicate the existing data object (minus the format you wish to remove) and set that to the clipboard in place of the original.