随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253


覆盖: WndProc
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
  protected
    procedure WndProc(var Message: TMessage); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.WndProc(var Message: TMessage);
begin
  inherited;
  if Message.Msg = WM_LBUTTONDOWN then
    ShowMessage('WndProc');
end;

end.


覆盖: Dispatch
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
  public
    procedure Dispatch(var Message); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

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

end.

posted on 2008-10-25 12:32  万一  阅读(...)  评论(...编辑  收藏