//覆盖虚消息处理函数WndProc
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 = class(TForm)
private
{ Private declarations }
protected
//覆盖虚消息处理函数WndProc
procedure WndProc(var Message: TMessage); override;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WndProc(var Message: TMessage);
begin
inherited WndProc(Message);
//截获鼠标左键按下的消息
if Message.Msg=WM_LBUTTONDOWN then
Showmessage('截获成功');
end;
end.