pyscripter 689 Posted June 5, 2021 The OleSetClipboardData documentation claims that the Clipboard implements delayed rendering, meaning that it renders a given format of the IDataObject implementation, only when the format is actually requested. My DataObject implements CF_UNICODETEXT and CF_HTML formats. As soon as I call OleSetClipboardData both formats are rendered. Any idea why is that? How can one implement delayed (lazy) rendering of clipboard formats? Share this post Link to post
Anders Melander 1783 Posted June 5, 2021 Works for me. Here's what I'm seeing when I copy to the clipboard using the Drop Target Analyzer from the D&D Component Suite: I copied to the clipboard (blue bullets) and after a while (3.6 seconds) I pasted from the clipboard. The red bullets indicates the calls made from the drop target to the drop source. The list on the right are the data formats requested by the drop target. As you can see there are no calls made on the IDataObject until I paste from the clipboard. Here's the corresponding view from the drop target (the Drop Source Analyzer): Maybe you have an application running which monitors and reads from the clipboard? 1 Share this post Link to post
pyscripter 689 Posted June 6, 2021 Thanks @Anders Melander. It could be the Windows 10 multi-device clipboard that results in this, or else some formats like CF_UNICODETEXT are translated automatically say to CF_TEXT for compatibility with the OLE 1.0 Clipboard. Share this post Link to post
Anders Melander 1783 Posted June 6, 2021 16 hours ago, pyscripter said: or else some formats like CF_UNICODETEXT are translated automatically say to CF_TEXT for compatibility with the OLE 1.0 Clipboard. The clipboard will synthesize some formats from others (e.g. CF_TEXT from CF_UNICODETEXT) but only if the target asks for that format and only if the source hasn't already provided it. See Synthesized Clipboard Formats. Did you remember to specify zero for the hMem parameter of SetClipboardData? - and do you handle the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages? Share this post Link to post
pyscripter 689 Posted June 6, 2021 3 minutes ago, Anders Melander said: Did you remember to specify zero for the hMem parameter of SetClipboardData? - and do you handle the WM_RENDERFORMAT and WM_RENDERALLFORMATS messages? I am using OleSetClipboardData with a IDataObject. This does not have any other arguments. And I am not handling WM_RENDERFORMAT or WM_RENDERALLFORMATS. These messages are handled by the OLE clipboard. Share this post Link to post
Anders Melander 1783 Posted June 6, 2021 1 minute ago, pyscripter said: I am using OleSetClipboardData with a IDataObject. Yes, forget what I wrote. I got things confused. Share this post Link to post