unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FOldWndProc, FNewWndProc: TFarProc;
procedure WindowProc(var Message: TMessage);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WindowProc(var Message: TMessage);
begin
Message.Result := CallWindowProc(FOldWndProc, Edit1.Handle, Message.Msg,
Message.WParam, Message.LParam);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
FNewWndProc := MakeObjectInstance(WindowProc);
FOldWndProc := Pointer(GetWindowLong(Edit1.Handle, GWL_WNDPROC));
SetWindowLong(Edit1.Handle, GWL_WNDPROC, LongInt(FNewWndProc));
end;end.
Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FOldWndProc, FNewWndProc: TFarProc;
procedure WindowProc(var Message: TMessage);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.WindowProc(var Message: TMessage);
begin
Message.Result := CallWindowProc(FOldWndProc, Edit1.Handle, Message.Msg,
Message.WParam, Message.LParam);
end;procedure TForm1.FormCreate(Sender: TObject);
begin
FNewWndProc := MakeObjectInstance(WindowProc);
FOldWndProc := Pointer(GetWindowLong(Edit1.Handle, GWL_WNDPROC));
SetWindowLong(Edit1.Handle, GWL_WNDPROC, LongInt(FNewWndProc));
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货