Solved

Copy selected text to clipboard

Posted on 2000-04-08
6
169 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
  • 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
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.

 
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 50 total points
ID: 2697187
Thanks.
0
 
LVL 1

Author Comment

by:isis071598
ID: 2697340
Thanks a bunch!
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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

13 Experts available now in Live!

Get 1:1 Help Now