Solved

Disable copy/cut/past from Tedit

Posted on 1997-08-30
2
339 Views
Last Modified: 2012-05-04
hi
how can diable cut/copy/paste and even "color" text for such an operation on Tedit component ?
0
Comment
Question by:asi
2 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1343153
This is an example for COPY. Figure out what it does and do the same for cut and paste. write the following:

procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.OnMessage := AppMessage;
end;

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
if (Msg.hwnd = edit1.Handle) and //if the focus is in the edit1
   (Msg.Message=WM_KEYDOWN) and //if the user pressed a key
   ((Msg.wParam = 67) OR (Msg.wParam = 99)) then //if C or c was pressed
begin
    if GetKeyState(VK_CONTROL) < 0 then  //if control key is down            
    showmessage('copy is canceled');
    Handled := True;//cancel the copy action
end;


0
 

Author Comment

by:asi
ID: 1343154
10x alot its help me to get to my target
asi
b_asi@inter.net.il

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

896 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

11 Experts available now in Live!

Get 1:1 Help Now