Solved

Clipboard Paste or CTRL+V

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 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

17 Experts available now in Live!

Get 1:1 Help Now