覆盖: 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.