Solved

Pasting to any open window.

Posted on 1998-03-10
1
135 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 20 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

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