component TacTimerComponent class
Return to Introduction 

  TacTimerComponent = class(TacComponent)  
    procedure UpdateTimer; virtual;  
    function  CanSetTimer: Boolean; virtual;  
    procedure DoTimer; virtual;  
    property MonitorActive: Boolean;  
    property MonitorInterval: Integer;  
    property Handle: THandle;  

The TacTimerComponent is the base class for some successors of TacComponent which uses the internal timer for some purposes. The TacTimerComponent is ancestor for such components like TacAwayTimer (there is timer used to monitor user's activity), TacCursorLocker (used to monitor whether active form changed) and TacSimpleTCPClient (used for auto-reconnecting after specified interval).  
The TacTimerComponent allocates the window handle (Handle property) to receive WM_TIMER messages. The activity of internal timer controlled by MonitorActivity property and the interval between timer messages (amount of time that passes before receving another timer method) specified in MonitorInterval property.  
All successors of TacTimerComponent have published MonitorActive and MonitorInterval property (however the names of these properties can be changed, depending on component purposes), and hooked DoTimer method (to execute some specific actions when it receiving WM_TIMER message). Additionally, successors can hook CanSetTimer method, to control whether it can't set timer for some reason; and UpdateTimer method, to execute some actions when the timer interval or activity changed.  

See also
TacFormHookComponent and TacAppHookComponent classes.