Solved

Pasting to any open window.

Posted on 1998-03-10
1
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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