Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pasting to any open window.

Posted on 1998-03-10
1
Medium Priority
?
141 Views
Last Modified: 2012-05-09
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.
0
Comment
Question by:sparklin
1 Comment
 
LVL 5

Accepted Solution

by:
inter earned 40 total points
ID: 1360398
Hi,

Normaly you do this as

    SendMessage(iHwnd, WM_PASTE, 0, 0);
             where iHwnd is the handle of the control(Edit, combo, label, etc...).

Igor
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question