0

I execute the following code to copy the whole text from a TEmbeddedWB to the clipboard:

EWBH.ExecWB(OLECMDID_SELECTALL,      OLECMDEXECOPT_DODEFAULT);
EWBH.ExecWB(OLECMDID_COPY,           OLECMDEXECOPT_DODEFAULT);
EWBH.ExecWB(OLECMDID_CLEARSELECTION, OLECMDEXECOPT_DONTPROMPTUSER);

However, when closing the program after this, something automatically copies the same content AGAIN. I have checked that this code is NOT executed again, so it must be something else (TEmbeddedWB?) which does the copying when the program closes.

Is there something wrong with the code above? How can I prevent the additional copying when the program closes?

EDIT201404011858: It seems that the problem does not occur if after the execution of the above code something else is copied to the clipboard.

user1580348
  • 5,721
  • 4
  • 43
  • 105
  • For a work around you could copy something small to the clipboard on exiting. You could also work around it by extracting the contents of the clipboard in code and then putting it back in the clipboard so it would be your code adding the code to the clipboard instead of the embedded WB. – Graymatter Apr 01 '14 at 18:35
  • It's probably a delayed rendering cleanup. i.e. it copied complex formats such as CF_HTML or CF_RTF to the clipboard, but did so using delayed rendering. So it feels the need to "resolve" that data if it still owns the clipboard when it closes. – Chris Thornton Apr 02 '14 at 23:24

0 Answers0