Solved

Disable copy/cut/past from Tedit

Posted on 1997-08-30
2
368 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
[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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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