unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
RichEdit1: TRichEdit;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
OldWinProc: TWndMethod;
procedure NewWinProc(var Message: TMessage);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.NewWinProc(var Message: TMessage);
begin
case Message.Msg of
WM_HSCROLL:
begin
caption := caption + 'WM_HSCROLL';
end;
WM_VSCROLL:
begin
caption := caption + 'WM_VSCROLL';
end;
end; //end of case
OldWinProc(Message);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OldWinProc := RichEdit1.WindowProc;
RichEdit1.WindowProc := NewWinProc;
end;
end.