You're right! I expressed myself poorly
--------------
Of course, I'm attaching the final code.
https://drive.google.com/file/d/1MJiFqibY6JvzJdrZtbmI3XnVD-HxRwwb/view?usp=sharingI think we can end this topic as resolved!
I kept creating a "ThreadTeste" as property of TForm1 because
is part of the concept that I intend to use, a Thread just to monitor and inform the state of the Threads daughter
to a "console".
I do not know if this architecture is the best or the right one, so I'm going to use it anyway because it helps me
to know exactly what is happening with the program, the logs that I send today to the memo,
will be sent to a socket channel that I will use to monitor the daemon / service.
If you look at the example, it was not necessary to put the OnClose of Form1 to the destruction of ThreadTeste,
I kept the "Stop Thread" button, without errors, without memory leaks!
The auxiliary events,
OnScheduleRun,
OnScheduleStop,
OnScheduleAbort,
OnScheduleInvalid,
OnMaxEventsExecuted
are not triggered inside the Synchronize, do not belong to this time and therefore had no problem in uncommenting.
The current solution already caters me, in the future I will better study the management of this list of tasks including
and deleting items without having to stop the "ThreadTeste", which controls the logs.
I will probably put another method in the Synchronize to re-organize the list before entering the log, but this I will try to do first, its I can not get help from the forum.
I loved it, you were 1000!