一般需要处理的消息都会和一个特定的事件挂钩
比如 cm-textchanged => OnChange事件等
另外的一些消息由Delphi自动完成,不需要特别处理,
假如你一定要截获它自己处理,则可以这样做:
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    FOldWndProc: TWndMethod;
    procedure ButtonWindowProc(var Message: TMessage);
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}procedure TForm1.ButtonWindowProc(var Message: TMessage);
begin
  FWndProc( Message );
  //Do your things...
end;procedure TForm1.FormCreate(Sender: TObject);
begin
  FOldWndProc := Button1.WindowProc;
  Button1.WindowProc := ButtonWindowProc;
end;end.