Solved

Copy selected text to clipboard

Posted on 2000-04-08
6
167 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
Comment Utility
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
Comment Utility
Any chance of a bit of source?

Regards,
Isis
0
 
LVL 6

Expert Comment

by:DrDelphi
Comment Utility
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
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.

 
LVL 1

Author Comment

by:isis071598
Comment Utility
DrDelphi - Looks good - the points are yours. Answer it.

0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 50 total points
Comment Utility
Thanks.
0
 
LVL 1

Author Comment

by:isis071598
Comment Utility
Thanks a bunch!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

8 Experts available now in Live!

Get 1:1 Help Now