TTimer很特殊

TTimer = class(TComponent)
private
FInterval: Cardinal;
FWindowHandle: HWND;
FOnTimer: TNotifyEvent;
FEnabled: Boolean;
procedure UpdateTimer;
procedure SetEnabled(Value: Boolean);
procedure SetInterval(Value: Cardinal);
procedure SetOnTimer(Value: TNotifyEvent);
procedure WndProc(var Msg: TMessage);
protected
procedure Timer; dynamic;
{$IF DEFINED(CLR)}
strict protected
procedure Finalize; override;
{$IFEND}
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Enabled: Boolean read FEnabled write SetEnabled default True;
property Interval: Cardinal read FInterval write SetInterval default 1000;
property OnTimer: TNotifyEvent read FOnTimer write SetOnTimer;
end;

 

明明继承自TComponent,不仅自带FWindowHandle 而且自定义WndProc ,留个爪,以后再回来研读。可能是不想带上TControl或者TWinControl的其它一大堆玩意吧。

你可能感兴趣的:(timer)