Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Copy selected text to clipboard

Posted on 2000-04-08
6
Medium Priority
?
215 Views
Last Modified: 2010-04-04
This sounds simple I know but is there a simple way to copy the selected text of a memo to the clipboard directly?

I know about memo1.copytoclipboard but it only copies all the controls text.. or am I missing something?
0
Comment
Question by:isis071598
[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
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:edey
ID: 2697017
you can send the memo a:

WM_COPY

wParam = 0; // not used; must be zero
lParam = 0; // not used; must be zero
 

An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.



GL
mike
0
 
LVL 1

Author Comment

by:isis071598
ID: 2697030
Any chance of a bit of source?

Regards,
Isis
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2697039
var Clip:TClipBoard;
    SelText:string;
begin
    Clip:=TClipBoard.Create;
    Memo1.Selstart:=0;
    Memo1.sellength:=25;
    Seltext:=Copy(Memo1.Lines.GetText,Memo1.SelStart,Memo1.SelLength);
    Clip.SetTextBuf(pchar(SelText));
end;



/// obviously, you can disregard the part where I set SelStart and SelLength if you are selcting the text manually.


Good luck!!
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 1

Author Comment

by:isis071598
ID: 2697045
DrDelphi - Looks good - the points are yours. Answer it.

0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 200 total points
ID: 2697187
Thanks.
0
 
LVL 1

Author Comment

by:isis071598
ID: 2697340
Thanks a bunch!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 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