Solved

Clipboard Paste or CTRL+V

Posted on 2002-04-05
4
1,949 Views
Last Modified: 2008-02-01
I need to paste from the Clipboard anywhere in Windows. In other words I either want to have a Delphi command that would take the Clipboard text and paste it or to simulate CTRL+V and effectively paste the clipbaord text. This is outside of my Delphi Application without it having focus. I would really appreciate some examples.
0
Comment
Question by:skynergy
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:Dennis9
ID: 6920561
You could use this:

procedure TMainform.Button1Click(Sender: TObject);
begin
  Keybd_event(VK_CONTROL, 0, 0, 0);
  Keybd_event(Byte('V'), 0, 0, 0);
  Keybd_event(Byte('V'), 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
end;

Cheers Dennis
0
 
LVL 1

Accepted Solution

by:
Dennis9 earned 50 total points
ID: 6920563
You could use this:

procedure TMainform.Button1Click(Sender: TObject);
begin
  Keybd_event(VK_CONTROL, 0, 0, 0);
  Keybd_event(Byte('V'), 0, 0, 0);
  Keybd_event(Byte('V'), 0, KEYEVENTF_KEYUP, 0);
  Keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
end;

Cheers Dennis
0
 

Author Comment

by:skynergy
ID: 6920615
Thanx that's excellent!
0
 

Author Comment

by:skynergy
ID: 6920620
Thanx that's excellent Dennis!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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