Solved

Pasting to any open window.

Posted on 1998-03-10
1
132 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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 this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now