2 * Task Scheduler Service interface
4 * Copyright (C) 2008 Google (Roy Shea)
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 uuid(148BD528
-A2AB
-11CE
-B11F
-00AA00530503
),
29 pointer_default(unique)
31 interface IEnumWorkItems
: IUnknown
35 [out] LPWSTR
**rgpwszNames
,
36 [out] ULONG
*pceltFetched
);
44 [out] IEnumWorkItems
**ppEnumWorkItems
);
47 cpp_quote
("#ifndef _HPROPSHEETPAGE_DEFINED")
48 typedef struct _PSP
*HPROPSHEETPAGE
;
49 cpp_quote
("#define _HPROPSHEETPAGE_DEFINED")
55 uuid(4086658a
-cbbb
-11cf
-b604
-00c04fd8d565
),
56 pointer_default(unique)
58 interface IProvideTaskPage
: IUnknown
60 typedef enum _TASKPAGE
{
62 TASKPAGE_SCHEDULE
= 1,
68 [in] BOOL fPersistChanges
,
69 [out] HPROPSHEETPAGE
*phPage
);
75 uuid(148BD52B
-A2AB
-11CE
-B11F
-00AA00530503
),
76 pointer_default(unique)
78 interface ITaskTrigger
: IUnknown
80 typedef enum _TASK_TRIGGER_TYPE
{
81 TASK_TIME_TRIGGER_ONCE
= 0,
82 TASK_TIME_TRIGGER_DAILY
= 1,
83 TASK_TIME_TRIGGER_WEEKLY
= 2,
84 TASK_TIME_TRIGGER_MONTHLYDATE
= 3,
85 TASK_TIME_TRIGGER_MONTHLYDOW
= 4,
86 TASK_EVENT_TRIGGER_ON_IDLE
= 5,
87 TASK_EVENT_TRIGGER_AT_SYSTEMSTART
= 6,
88 TASK_EVENT_TRIGGER_AT_LOGON
= 7
89 } TASK_TRIGGER_TYPE
, *PTASK_TRIGGER_TYPE
;
91 typedef struct _DAILY
{
95 typedef struct _WEEKLY
{
97 WORD rgfDaysOfTheWeek
;
100 typedef struct _MONTHLYDATE
{
105 typedef struct _MONTHLYDOW
{
107 WORD rgfDaysOfTheWeek
;
111 typedef union _TRIGGER_TYPE_UNION
{
114 MONTHLYDATE MonthlyDate
;
115 MONTHLYDOW MonthlyDOW
;
116 } TRIGGER_TYPE_UNION
;
118 typedef struct _TASK_TRIGGER
{
129 DWORD MinutesDuration
;
130 DWORD MinutesInterval
;
132 TASK_TRIGGER_TYPE TriggerType
;
133 TRIGGER_TYPE_UNION Type
;
135 WORD wRandomMinutesInterval
;
136 } TASK_TRIGGER
, *PTASK_TRIGGER
;
139 [in] const PTASK_TRIGGER pTrigger
);
142 [out] PTASK_TRIGGER pTrigger
);
144 HRESULT GetTriggerString
(
145 [out] LPWSTR
*ppwszTrigger
);
151 uuid(a6b952f0
-a4b1
-11d0
-997d
-00aa006887ec
),
152 pointer_default(unique)
154 interface IScheduledWorkItem
: IUnknown
156 HRESULT CreateTrigger
(
157 [out] WORD
*piNewTrigger
,
158 [out] ITaskTrigger
**ppTrigger
);
160 HRESULT DeleteTrigger
(
163 HRESULT GetTriggerCount
(
164 [out] WORD
*plCount
);
168 [out] ITaskTrigger
**ppTrigger
);
170 HRESULT GetTriggerString
(
172 [out] LPWSTR
*ppwszTrigger
);
175 [in] const LPSYSTEMTIME pstBegin
,
176 [in] const LPSYSTEMTIME pstEnd
,
177 [in, out] WORD
*pCount
,
178 [out] LPSYSTEMTIME
*rgstTaskTimes
);
180 HRESULT GetNextRunTime
(
181 [out] SYSTEMTIME
*pstNextRun
);
184 [in] WORD wIdleMinutes
,
185 [in] WORD wDeadlineMinutes
);
188 [out] WORD
*pwIdleMinutes
,
189 [out] WORD
*pwDeadlineMinutes
);
195 HRESULT EditWorkItem
(
197 [in] DWORD dwReserved
);
199 HRESULT GetMostRecentRunTime
(
200 [out] SYSTEMTIME
*pstLastRun
);
203 [out] HRESULT *phrStatus
);
206 [out] DWORD
*pdwExitCode
);
209 [in] LPCWSTR pwszComment
);
212 [out] LPWSTR
*ppwszComment
);
215 LPCWSTR pwszCreator
);
218 [out] LPWSTR
*ppwszCreator
);
220 HRESULT SetWorkItemData
(
222 [in] BYTE rgbData
[]);
224 HRESULT GetWorkItemData
(
226 [out] BYTE **ppBytes
);
228 HRESULT SetErrorRetryCount
(
231 HRESULT GetErrorRetryCount
(
232 [out] WORD
*pwRetryCount
);
234 HRESULT SetErrorRetryInterval
(
235 WORD wRetryInterval
);
237 HRESULT GetErrorRetryInterval
(
238 [out] WORD
*pwRetryInterval
);
244 [out] DWORD
*pdwFlags
);
246 HRESULT SetAccountInformation
(
247 [in] LPCWSTR pwszAccountName
,
248 [in] LPCWSTR pwszPassword
);
250 HRESULT GetAccountInformation
(
251 [out] LPWSTR
*ppwszAccountName
);
257 uuid(148BD524
-A2AB
-11CE
-B11F
-00AA00530503
),
258 pointer_default(unique)
260 interface ITask
: IScheduledWorkItem
262 HRESULT SetApplicationName
(
263 [in] LPCWSTR pwszApplicationName
);
265 HRESULT GetApplicationName
(
266 [out] LPWSTR
*ppwszApplicationName
);
268 HRESULT SetParameters
(
269 [in] LPCWSTR pwszParameters
);
271 HRESULT GetParameters
(
272 [out] LPWSTR
*ppwszParameters
);
274 HRESULT SetWorkingDirectory
(
275 [in] LPCWSTR pwszWorkingDirectory
);
277 HRESULT GetWorkingDirectory
(
278 [in] LPWSTR
*ppwszWorkingDirectory
);
281 [in] DWORD dwPriority
);
284 [out] DWORD
*pdwPriority
);
286 HRESULT SetTaskFlags
(
289 HRESULT GetTaskFlags
(
290 [out] DWORD
*pdwFlags
);
292 HRESULT SetMaxRunTime
(
293 [in] DWORD dwMaxRunTime
);
295 HRESULT GetMaxRunTime
(
296 [out] DWORD
*pdwMaxRunTime
);
302 uuid(148BD527
-A2AB
-11CE
-B11F
-00AA00530503
),
303 pointer_default(unique)
305 interface ITaskScheduler
: IUnknown
307 HRESULT SetTargetComputer
(
308 [in] LPCWSTR pwszComputer
);
310 HRESULT GetTargetComputer
(
311 [out] LPWSTR
*ppwszComputer
);
314 [out] IEnumWorkItems
**ppEnumTasks
);
317 [in] LPCWSTR pwszName
,
319 [out] IUnknown
**ppunk
);
322 [in] LPCWSTR pwszName
);
325 [in] LPCWSTR pwszTaskName
,
326 [in] REFCLSID rclsid
,
328 [out] IUnknown
**ppunk
);
331 [in] LPCWSTR pwszTaskName
,
332 [in] IScheduledWorkItem
*pWorkItem
);
335 [in] LPCWSTR pwszName
,
340 uuid(148BD52A
-A2AB
-11CE
-B11F
-00AA00530503
)
342 coclass CTaskScheduler
344 [default] interface ITaskScheduler
;
349 uuid(148BD520
-A2AB
-11CE
-B11F
-00AA00530503
)
353 [default] interface ITask
;