Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Cut and paste

Posted on 2004-08-30
8
Medium Priority
?
171 Views
Last Modified: 2010-04-05
Hello,

I want to create a simple application like this :

It has a button.

If I click that button, then it will send a text to the clipboard system.

So, if I press CTRL-V, that text will be pasted to notepad for example.

Anyone know how to send text (multiple lines) to clipboard system ?

thanks
0
Comment
Question by:kapot
[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
  • 4
  • 2
  • 2
8 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 180 total points
ID: 11930701
uses tclipboard;

...
begin
  Clipboard.SetTextBuf(PCHar('MyLongText'+#10+'SecondLine');
end;

just from head

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11930712
one ) missed on end
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 11930861
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (Memo1.SelLength>0) then
    Memo1.CopyToClipboard;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Memo2.PasteFromClipboard;
end;
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Assisted Solution

by:Colin_Dawson
Colin_Dawson earned 120 total points
ID: 11930886
you'd be better using #13#10 for the line  break.   #13 is a carriage return and #10 is a line feed.   Some programs will accept an either/or/or both combination, but there are some others that MUST have the pair.  Notepad itself isn't too fussy, but it's best to be complete.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11930928
well, agreed, colin :-))
0
 
LVL 4

Expert Comment

by:Colin_Dawson
ID: 11931662
Just call me "Mr. Pedantic" ;-)

Your suggestion answers the question so I think you should get the points.
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 11932704
I forgot to mention that it is a must to be into the uses-clause:

uses
  ...., Clipbrd
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11932801
hum, of course Clipbrd not tclipboard as i mentioned above (copy/paste error)
0

Featured Post

Independent Software Vendors: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

705 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