我在这里找到了这个C ++代码示例:创建任务触发器 https://msdn.microsoft.com/en-us/library/windows/desktop/aa446828(v=vs.85).aspx
我们有:
pTrigger.wBeginDay =1; // Required
pTrigger.wBeginMonth =1; // Required
pTrigger.wBeginYear =1999; // Required
pTrigger.cbTriggerSize = sizeof (TASK_TRIGGER);
pTrigger.wStartHour = 13;
pTrigger.TriggerType = TASK_TIME_TRIGGER_DAILY;
pTrigger.Type.Daily.DaysInterval = 1;
TriggerType为TASK_TRIGGER_TYPE。
typedef enum _TASK_TRIGGER_TYPE {
TASK_TIME_TRIGGER_ONCE = 0,
TASK_TIME_TRIGGER_DAILY = 1,
TASK_TIME_TRIGGER_WEEKLY = 2,
TASK_TIME_TRIGGER_MONTHLYDATE = 3,
TASK_TIME_TRIGGER_MONTHLYDOW = 4,
TASK_EVENT_TRIGGER_ON_IDLE = 5,
TASK_EVENT_TRIGGER_AT_SYSTEMSTART = 6,
TASK_EVENT_TRIGGER_AT_LOGON = 7
} TASK_TRIGGER_TYPE, *PTASK_TRIGGER_TYPE;
但我想每5分钟触发一次我的consolle应用程序。 建议?