问题
I saw an installed application, that feeds some XML data from the vendor's website and displays it in the Main Form window. Simple stuff, I suppose, but whgat I noticed was that, even when I close the Application in the system tray, tomorrow morning (at exactly 12:00AM) it pops ups again! This is so cool. I am not sure that it was written in Delphi, probably some .NET IDE or somehting.
Can Delphi XE2 achieve this? If so, how can I get that to work?
回答1:
Windows can achieve this: Administrative Tools -> Task Scheduler
回答2:
If you need to add / manage Task Scheduler in your delphi application, there is a JCL library specially created for that :
http://wiki.delphi-jedi.org/wiki/JCL_Help:JclTask.pas
There is no documentation but you can see the source code and use the TJclTaskSchedule to add executing your own application in Task Scheduler.
回答3:
To automatically create a scheduled Task either use the "schtasks.exe" command line utility that comes with Windows or an interface to the Task Scheduler API. An alternative to the JCL library is the commercial "VCL Scheduling Agent" component for Delphi.
来源:https://stackoverflow.com/questions/9697221/can-i-make-my-delphi-app-start-at-a-specific-time-like-1200am-without-the-ap