For the timer to work, your program must process messages . In the GUI program, this part is automatic; the TApplication class provides this for you. But you say that you have a "formless" program, so I assume that you are probably not calling Application.Run in your DPR file.
To use the timer, you need to process the messages. A typical starting point for a message pump is this code:
while Integer(GetMessage(Msg, 0, 0, 0)) > 0 do begin TranslateMessage(Msg); DispatchMessage(Msg); end;
When the timer expires, the OS effectively places the wm_Timer message in the program message queue. The GetMessage call GetMessage messages out of the queue, and DispatchMessage calls the destination window window procedure. TTimer creates a hidden window for itself to serve as a target for these messages, and DispatchMessage ensures that they get there.
Rob kennedy
source share