DelphiFAQ Home Search:
General :: Programming :: Delphi :: VCL
About the Delphi VCL (Visual Component Library)

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

When does Application.OnIdle() get executed?

Question:

I wanted to have some code executed within my application when a certain time has come (like a scheduler). I put the code to check current system time against that scheduled time in the OnIdle event but it does not always work. Why?

Answer:

The OnIdle event fires every time the application goes idle. It does not fire again until the application has done something and then goes idle again.

To do your scheduling, you will have to use a TTimer instance which you could have execute every minute (if you have multiple events scheduled; this is also known as a software timer as opposed to having tons of TTimer instances for all of your events).. or have your TTimer fire only once at exactly the time when your event is scheduled.

You could also look into WaitForMultipleObjects and WaitForSingleObject.


Generated 0:01:43 on Aug 11, 2020