覆盖Dispatch响应消息

1 

源代码:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  protected
     procedure Dispatch(var Message);override;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

{ TForm1 }

procedure TForm1.Dispatch(var Message);
begin
  inherited;
  if Tmessage(Message).Msg=WM_LBUTTONDOWN then
  begin
    ShowMessage('Dispatch');
  end;

end;

end.

 

posted @ 2010-02-15 16:17  猪悟能  阅读(213)  评论(0编辑  收藏  举报