Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
Delphi 5 Professional
|
Re: Strg+V im TEdit abfangen
24. Aug 2005, 11:26
Delphi-Quellcode:
type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
OldWndProcEdit1: TWndMethod;
procedure WndProcEdit1(var Message: TMessage);
end;
Delphi-Quellcode:
{--------------------------------------------------------------------------------------------------}
procedure TForm1.WndProcEdit1(var Message: TMessage);
const
S_MSG = 'Soll der Text "%s" in Edit1 eingefügt werden?';
begin
if Message.Msg = WM_PASTE then
if MessageDlg(Format(S_MSG, [Clipboard.AsText]), mtConfirmation, [mbYes, mbNo], 0) = mrNo then
Exit;
OldWndProcEdit1(Message);
end;
{--------------------------------------------------------------------------------------------------}
procedure TForm1.FormCreate(Sender: TObject);
begin
OldWndProcEdit1 := Edit1.WindowProc;
Edit1.WindowProc := WndProcEdit1;
end;
{--------------------------------------------------------------------------------------------------}
Ciao, Sprint.
"I don't know what I am doing, but I am sure I am having fun!"
|
|
Zitat
|