Solved

Clipboard Paste or CTRL+V

Posted on 2002-04-05
4
1,880 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

9 Experts available now in Live!

Get 1:1 Help Now