Link to home
Start Free TrialLog in
Avatar of sparklin
sparklin

asked on

Pasting to any open window.

I have the iHwnd of a window and I need to copy the current contents of the clipboard into this window.  I have the following code but am unsure as to how to invoke a windows paste type command.


 begin
    SetForeGroundWindow(iHwnd);
 try
   ClipBoard.Open;
   Handle := Clipboard.GetAsHandle(CF_TEXT);
   TextPtr := GlobalLock(Handle);
   sClipboard := StrPas(TextPtr);
   {Paste Command needs to be inserted here!}
   GlobalUnlock(Handle);
 finally
   Clipboard.Close;
 end;

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of inter
inter
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial