unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
procedure mymessage(var msg:tmsg;var handled:boolean);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure tform1.mymessage(var msg:tmsg;var handled:boolean);
begin
if msg.hwnd =edit1.handle then
begin
if msg.message =wm_rbuttonup then
begin
handled:=true;
end;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
application.OnMessage :=mymessage;
end;
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((key=ord('x')) or (key=ord('X')) or
((key=ord('c')) or (key=ord('C')) or
(key=ord('v')) or (key=ord('V'))))
and (Shift=[ssCtrl]) then
begin
Edit1.Tag :=1;
end;
end;
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if edit1.tag=1 then
begin
key:=#0;
edit1.tag:=0;
end;
end;
end.