使用 QT 的任务计划程序 API [英] Task Scheduler API using QT

查看:52
本文介绍了使用 QT 的任务计划程序 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据周期日期实现一个任务调度程序,有没有办法通过 QT 使用 API 来实现它?另一个问题,我应该指定windows当前用户的用户名和密码吗?

I'd like to Implement a task scheduler based on a periodic date, Is there a way to implement it using an API by QT ? Another Question , Should I specify the username and the password of the current user of the windows ?

推荐答案

如果您想使用 Windows 任务调度程序,您需要为此使用 COM API - http://msdn.microsoft.com/en-us/library/aa383614%28v=vs.85%29.aspx

If you want to use the windows task scheduler you'll need to use the COM API for that - http://msdn.microsoft.com/en-us/library/aa383614%28v=vs.85%29.aspx

Qt 不提供用于任务调度的通用 API,因为这种东西在不同平台(Windows 任务调度程序 VS unix 上的 cron)中通常有很大不同,并且某些平台(移动?)甚至可能没有等效的 API.

Qt does not provide a generic API for task scheduling because this kind of thing is usually vastly different in different platforms (Windows task scheduler VS cron on unix) and some platforms (mobile?) probably don't even have an equivalent.

另一种选择是通过创建一个始终在后台运行的进程来拉取您自己的任务调度.一种选择是在登录时启动的常规无窗口进程,另一种选择是 Windows 服务,出于同样的原因,它同样需要一些本机 API 的使用.请注意,始终运行的独立进程通常会受到用户的反对,其中一些可能只是终止您的进程或禁用您在登录时用于启动它的任何机制.计划任务更加模糊,不太可能被用户禁用.

Another option is to pull your own task scheduling by making a process that runs all the time on the background. One option for this is just a regular window-less process that starts on login and another is a windows service which, again, requires some usage of the native API for much the same reasons. Be mindful that a stand alone process that runs all the time is usually frowned upon by users and some of them are likely to just kill your process or disable the whichever mechanism you use to start it up upon login. Scheduled tasks are more obscure and are less likely to be disabled by the user.

这篇关于使用 QT 的任务计划程序 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆