Mega Code Archive

 
Categories / Delphi / API
 

Copying contents of a control to the clipboard

Question: How do I get a control in another window to copy it's contents to the Windows clipboard? Answer: Send a WM_COPY message to the active window to tell it to copy its contents to the clipboard. If the control does not support the message, it is simply ignored, and no exception is raised. Example: SendMessage(Edit1.handle, WM_COPY, 0, 0);