Can I make my Delphi App start at a specific time (like 12:00AM), without the application running?

淺唱寂寞╮ 提交于 2021-02-05 08:46:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!