/
MSTask.pas
699 lines (616 loc) · 24.8 KB
/
MSTask.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
{**************************************************************************************************}
{ }
{ Last modified: $Date:: $ }
{ Revision: $Rev:: $ }
{ Author: $Author:: $ }
{ }
{**************************************************************************************************}
(*****************************************************************************
This IDL-file has been converted by "the fIDLer".
[written by -=Assarbad=- <oliver at assarbad dot net> Sept-2004] under MPL
Visit the fIDLer homepage at: http://assarbad.net/en/stuff/
{The 3 above lines should be retained}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE:
There's no guarantee for correct case of parameter or variable types.
If you have a type like BLA_YADDA in IDL then fIDLer will have converted it
to 'TBlaYadda' already. But if the type identifier was BLAYADDA and both
BLA and YADDA being distinct words the result will not be correctly
capitalized!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The original file was 'MSTask.Idl'
File converted: 2004-10-08@18:38:57
Cosmetics and review by:
2004-10-08 - Oliver Schneider <oliver at assarbad dot net>
Changes:
2004-11-15 - Scott Price <scottprice@users dot sourceforge dot net>
*****************************************************************************)
unit MSTask;
{$I jcl.inc}
{$I windowsonly.inc}
{$IFDEF SUPPORTS_WEAKPACKAGEUNIT}
{$IFDEF UNITVERSIONING}
{$WEAKPACKAGEUNIT OFF}
{$ELSE ~UNITVERSIONING}
{$WEAKPACKAGEUNIT ON}
{$ENDIF ~UNITVERSIONING}
{$ENDIF SUPPORTS_WEAKPACKAGEUNIT}
{$ALIGN ON}
{$MINENUMSIZE 4}
interface
uses
{$IFDEF UNITVERSIONING}
JclUnitVersioning,
{$ENDIF UNITVERSIONING}
{$IFDEF HAS_UNITSCOPE}
Winapi.ActiveX, Winapi.Windows;
{$ELSE ~HAS_UNITSCOPE}
ActiveX, Windows;
{$ENDIF ~HAS_UNITSCOPE}
//DOM-IGNORE-BEGIN
(*$HPPEMIT '#include <MSTask.h>' *)
//+----------------------------------------------------------------------------
//
// Task Scheduler
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1999.
//
// File: mstask.idl
//
// Contents: ITaskTrigger, ITask, ITaskScheduler, IEnumWorkItems
// interfaces and related definitions
//
// History: 06-Sep-95 EricB created
//
//-----------------------------------------------------------------------------
// import "oaidl.idl";
// import "oleidl.idl";
// 148BD520-A2AB-11CE-B11F-00AA00530503 - Task object class ID
// 148BD52A-A2AB-11CE-B11F-00AA00530503 - Task Scheduler class ID
// A6B952F0-A4B1-11D0-997D-00AA006887EC - IScheduledWorkItem interface ID
// 148BD524-A2AB-11CE-B11F-00AA00530503 - ITask interface ID
// 148BD527-A2AB-11CE-B11F-00AA00530503 - ITaskScheduler interface ID
// 148BD528-A2AB-11CE-B11F-00AA00530503 - IEnumWorkItems interface ID
// 148BD52B-A2AB-11CE-B11F-00AA00530503 - ITaskTrigger interface ID
//+----------------------------------------------------------------------------
//
// Datatypes
//
//-----------------------------------------------------------------------------
const
{$EXTERNALSYM TASK_SUNDAY}
TASK_SUNDAY = $1;
const
{$EXTERNALSYM TASK_MONDAY}
TASK_MONDAY = $2;
const
{$EXTERNALSYM TASK_TUESDAY}
TASK_TUESDAY = $4;
const
{$EXTERNALSYM TASK_WEDNESDAY}
TASK_WEDNESDAY = $8;
const
{$EXTERNALSYM TASK_THURSDAY}
TASK_THURSDAY = $10;
const
{$EXTERNALSYM TASK_FRIDAY}
TASK_FRIDAY = $20;
const
{$EXTERNALSYM TASK_SATURDAY}
TASK_SATURDAY = $40;
const
{$EXTERNALSYM TASK_FIRST_WEEK}
TASK_FIRST_WEEK = 1;
const
{$EXTERNALSYM TASK_SECOND_WEEK}
TASK_SECOND_WEEK = 2;
const
{$EXTERNALSYM TASK_THIRD_WEEK}
TASK_THIRD_WEEK = 3;
const
{$EXTERNALSYM TASK_FOURTH_WEEK}
TASK_FOURTH_WEEK = 4;
const
{$EXTERNALSYM TASK_LAST_WEEK}
TASK_LAST_WEEK = 5;
const
{$EXTERNALSYM TASK_JANUARY}
TASK_JANUARY = $1;
const
{$EXTERNALSYM TASK_FEBRUARY}
TASK_FEBRUARY = $2;
const
{$EXTERNALSYM TASK_MARCH}
TASK_MARCH = $4;
const
{$EXTERNALSYM TASK_APRIL}
TASK_APRIL = $8;
const
{$EXTERNALSYM TASK_MAY}
TASK_MAY = $10;
const
{$EXTERNALSYM TASK_JUNE}
TASK_JUNE = $20;
const
{$EXTERNALSYM TASK_JULY}
TASK_JULY = $40;
const
{$EXTERNALSYM TASK_AUGUST}
TASK_AUGUST = $80;
const
{$EXTERNALSYM TASK_SEPTEMBER}
TASK_SEPTEMBER = $100;
const
{$EXTERNALSYM TASK_OCTOBER}
TASK_OCTOBER = $200;
const
{$EXTERNALSYM TASK_NOVEMBER}
TASK_NOVEMBER = $400;
const
{$EXTERNALSYM TASK_DECEMBER}
TASK_DECEMBER = $800;
const
{$EXTERNALSYM TASK_FLAG_INTERACTIVE}
TASK_FLAG_INTERACTIVE = $1;
const
{$EXTERNALSYM TASK_FLAG_DELETE_WHEN_DONE}
TASK_FLAG_DELETE_WHEN_DONE = $2;
const
{$EXTERNALSYM TASK_FLAG_DISABLED}
TASK_FLAG_DISABLED = $4;
const
{$EXTERNALSYM TASK_FLAG_START_ONLY_IF_IDLE}
TASK_FLAG_START_ONLY_IF_IDLE = $10;
const
{$EXTERNALSYM TASK_FLAG_KILL_ON_IDLE_END}
TASK_FLAG_KILL_ON_IDLE_END = $20;
const
{$EXTERNALSYM TASK_FLAG_DONT_START_IF_ON_BATTERIES}
TASK_FLAG_DONT_START_IF_ON_BATTERIES = $40;
const
{$EXTERNALSYM TASK_FLAG_KILL_IF_GOING_ON_BATTERIES}
TASK_FLAG_KILL_IF_GOING_ON_BATTERIES = $80;
const
{$EXTERNALSYM TASK_FLAG_RUN_ONLY_IF_DOCKED}
TASK_FLAG_RUN_ONLY_IF_DOCKED = $100;
const
{$EXTERNALSYM TASK_FLAG_HIDDEN}
TASK_FLAG_HIDDEN = $200;
const
{$EXTERNALSYM TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET}
TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET = $400;
const
{$EXTERNALSYM TASK_FLAG_RESTART_ON_IDLE_RESUME}
TASK_FLAG_RESTART_ON_IDLE_RESUME = $800;
const
{$EXTERNALSYM TASK_FLAG_SYSTEM_REQUIRED}
TASK_FLAG_SYSTEM_REQUIRED = $1000;
const
{$EXTERNALSYM TASK_FLAG_RUN_ONLY_IF_LOGGED_ON}
TASK_FLAG_RUN_ONLY_IF_LOGGED_ON = $2000;
const
{$EXTERNALSYM TASK_TRIGGER_FLAG_HAS_END_DATE}
TASK_TRIGGER_FLAG_HAS_END_DATE = $1;
const
{$EXTERNALSYM TASK_TRIGGER_FLAG_KILL_AT_DURATION_END}
TASK_TRIGGER_FLAG_KILL_AT_DURATION_END = $2;
const
{$EXTERNALSYM TASK_TRIGGER_FLAG_DISABLED}
TASK_TRIGGER_FLAG_DISABLED = $4;
//
// 1440 = 60 mins/hour * 24 hrs/day since a trigger/TASK could run all day at
// one minute intervals.
//
const
{$EXTERNALSYM TASK_MAX_RUN_TIMES}
TASK_MAX_RUN_TIMES: Integer = 1440;
//
// The TASK_TRIGGER_TYPE field of the TASK_TRIGGER structure determines
// which member of the TRIGGER_TYPE_UNION field to use.
//
type
{$EXTERNALSYM _TASK_TRIGGER_TYPE}
_TASK_TRIGGER_TYPE = (
{$EXTERNALSYM TASK_TIME_TRIGGER_ONCE}
TASK_TIME_TRIGGER_ONCE, // 0 // Ignore the Type field.
{$EXTERNALSYM TASK_TIME_TRIGGER_DAILY}
TASK_TIME_TRIGGER_DAILY, // 1 // Use DAILY
{$EXTERNALSYM TASK_TIME_TRIGGER_WEEKLY}
TASK_TIME_TRIGGER_WEEKLY, // 2 // Use WEEKLY
{$EXTERNALSYM TASK_TIME_TRIGGER_MONTHLYDATE}
TASK_TIME_TRIGGER_MONTHLYDATE, // 3 // Use MONTHLYDATE
{$EXTERNALSYM TASK_TIME_TRIGGER_MONTHLYDOW}
TASK_TIME_TRIGGER_MONTHLYDOW, // 4 // Use MONTHLYDOW
{$EXTERNALSYM TASK_EVENT_TRIGGER_ON_IDLE}
TASK_EVENT_TRIGGER_ON_IDLE, // 5 // Ignore the Type field.
{$EXTERNALSYM TASK_EVENT_TRIGGER_AT_SYSTEMSTART}
TASK_EVENT_TRIGGER_AT_SYSTEMSTART, // 6 // Ignore the Type field.
{$EXTERNALSYM TASK_EVENT_TRIGGER_AT_LOGON}
TASK_EVENT_TRIGGER_AT_LOGON // 7 // Ignore the Type field.
);
{$EXTERNALSYM TASK_TRIGGER_TYPE}
TASK_TRIGGER_TYPE = _TASK_TRIGGER_TYPE;
TTaskTriggerType = _TASK_TRIGGER_TYPE;
{$EXTERNALSYM PTASK_TRIGGER_TYPE}
PTASK_TRIGGER_TYPE = ^_TASK_TRIGGER_TYPE;
PTaskTriggerType = ^_TASK_TRIGGER_TYPE;
type
{$EXTERNALSYM _DAILY}
_DAILY = packed record
DaysInterval: WORD;
end;
{$EXTERNALSYM DAILY}
DAILY = _DAILY;
TDaily = _DAILY;
type
{$EXTERNALSYM _WEEKLY}
_WEEKLY = packed record
WeeksInterval: WORD;
rgfDaysOfTheWeek: WORD;
end;
{$EXTERNALSYM WEEKLY}
WEEKLY = _WEEKLY;
TWeekly = _WEEKLY;
type
{$EXTERNALSYM _MONTHLYDATE}
_MONTHLYDATE = packed record
rgfDays: DWORD;
rgfMonths: WORD;
end;
{$EXTERNALSYM MONTHLYDATE}
MONTHLYDATE = _MONTHLYDATE;
TMonthlyDate = _MONTHLYDATE; // OS: Changed capitalization
type
{$EXTERNALSYM _MONTHLYDOW}
_MONTHLYDOW = packed record
wWhichWeek: WORD;
rgfDaysOfTheWeek: WORD;
rgfMonths: WORD;
end;
{$EXTERNALSYM MONTHLYDOW}
MONTHLYDOW = _MONTHLYDOW;
TMonthlyDOW = _MONTHLYDOW; // OS: Changed capitalization
type
{$EXTERNALSYM _TRIGGER_TYPE_UNION}
_TRIGGER_TYPE_UNION = packed record
case Integer of
0: (Daily: DAILY);
1: (Weekly: WEEKLY);
2: (MonthlyDate: MONTHLYDATE);
3: (MonthlyDOW: MONTHLYDOW);
end;
{$EXTERNALSYM TRIGGER_TYPE_UNION}
TRIGGER_TYPE_UNION = _TRIGGER_TYPE_UNION;
TTriggerTypeUnion = _TRIGGER_TYPE_UNION;
type
{$EXTERNALSYM _TASK_TRIGGER}
_TASK_TRIGGER = record // SP: removed packed record statement as seemed to affect SetTrigger
cbTriggerSize: WORD; // Structure size.
Reserved1: WORD; // Reserved. Must be zero.
wBeginYear: WORD; // Trigger beginning date year.
wBeginMonth: WORD; // Trigger beginning date month.
wBeginDay: WORD; // Trigger beginning date day.
wEndYear: WORD; // Optional trigger ending date year.
wEndMonth: WORD; // Optional trigger ending date month.
wEndDay: WORD; // Optional trigger ending date day.
wStartHour: WORD; // Run bracket start time hour.
wStartMinute: WORD; // Run bracket start time minute.
MinutesDuration: DWORD; // Duration of run bracket.
MinutesInterval: DWORD; // Run bracket repetition interval.
rgFlags: DWORD; // Trigger flags.
TriggerType: TASK_TRIGGER_TYPE; // Trigger type.
Type_: TRIGGER_TYPE_UNION; // Trigger data.
Reserved2: WORD; // Reserved. Must be zero.
wRandomMinutesInterval: WORD; // Maximum number of random minutes
// after start time.
end;
{$EXTERNALSYM TASK_TRIGGER}
TASK_TRIGGER = _TASK_TRIGGER;
TTaskTrigger = _TASK_TRIGGER;
{$EXTERNALSYM PTASK_TRIGGER}
PTASK_TRIGGER = ^_TASK_TRIGGER;
PTaskTrigger = ^_TASK_TRIGGER;
//+----------------------------------------------------------------------------
//
// Interfaces
//
//-----------------------------------------------------------------------------
//+----------------------------------------------------------------------------
//
// Interface: ITaskTrigger
//
// Synopsis: Trigger object interface. A Task object may contain several
// of these.
//
//-----------------------------------------------------------------------------
// {148BD52B-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM IID_ITaskTrigger}
IID_ITaskTrigger: TIID = (D1: $148BD52B; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
// interface ITaskTrigger;
type
{$EXTERNALSYM ITaskTrigger}
ITaskTrigger = interface(IUnknown)
['{148BD52B-A2AB-11CE-B11F-00AA00530503}']
// Methods:
function SetTrigger(const pTrigger: TTaskTrigger): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} const PTASK_TRIGGER pTrigger |*)
function GetTrigger(out pTrigger: TTaskTrigger): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} PTASK_TRIGGER pTrigger |*)
function GetTriggerString(out ppwszTrigger: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszTrigger |*)
end;
//+----------------------------------------------------------------------------
//
// Interface: IScheduledWorkItem
//
// Synopsis: Abstract base class for any runnable work item that can be
// scheduled by the task scheduler.
//
//-----------------------------------------------------------------------------
// {a6b952f0-a4b1-11d0-997d-00aa006887ec}
const
{$EXTERNALSYM IID_IScheduledWorkItem}
IID_IScheduledWorkItem: TIID = (D1: $A6B952F0; D2: $A4B1; D3: $11D0; D4: ($99, $7D, $00, $AA, $00, $68, $87, $EC));
// interface IScheduledWorkItem;
type
{$EXTERNALSYM IScheduledWorkItem}
IScheduledWorkItem = interface(IUnknown)
['{A6B952F0-A4B1-11D0-997D-00AA006887EC}']
// Methods concerning scheduling:
function CreateTrigger(out piNewTrigger: WORD; out ppTrigger: ITaskTrigger): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * piNewTrigger, {out} ITaskTrigger ** ppTrigger |*)
function DeleteTrigger(iTrigger: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD iTrigger |*)
function GetTriggerCount(out pwCount: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * pwCount |*)
function GetTrigger(iTrigger: WORD; out ppTrigger: ITaskTrigger): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD iTrigger, {out} ITaskTrigger ** ppTrigger |*)
function GetTriggerString(iTrigger: WORD; out ppwszTrigger: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD iTrigger, {out} LPWSTR * ppwszTrigger |*)
function GetRunTimes(pstBegin: PSystemTime; pstEnd: PSystemTime; var pCount: WORD; out rgstTaskTimes: PSystemTime): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} const LPSYSTEMTIME pstBegin, {in} const LPSYSTEMTIME pstEnd, {in; out} WORD * pCount, {out} LPSYSTEMTIME * rgstTaskTimes |*)
function GetNextRunTime(var pstNextRun: SYSTEMTIME): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in; out} SYSTEMTIME * pstNextRun |*)
function SetIdleWait(wIdleMinutes: WORD; wDeadlineMinutes: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD wIdleMinutes, {in} WORD wDeadlineMinutes |*)
function GetIdleWait(out pwIdleMinutes: WORD; out pwDeadlineMinutes: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * pwIdleMinutes, {out} WORD * pwDeadlineMinutes |*)
// Other methods:
function Run(): HRESULT; stdcall;
function Terminate(): HRESULT; stdcall;
function EditWorkItem(hParent: HWND; dwReserved: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} HWND hParent, {in} DWORD dwReserved |*)
function GetMostRecentRunTime(out pstLastRun: SYSTEMTIME): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} SYSTEMTIME * pstLastRun |*)
function GetStatus(out phrStatus: HRESULT): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} HRESULT * phrStatus |*)
function GetExitCode(out pdwExitCode: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} DWORD * pdwExitCode |*)
// Properties:
function SetComment(pwszComment: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszComment |*)
function GetComment(out ppwszComment: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszComment |*)
function SetCreator(pwszCreator: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszCreator |*)
function GetCreator(out ppwszCreator: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszCreator |*)
function SetWorkItemData(cbData: WORD; rgbData: PByte): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD cbData, {in} BYTE rgbData[] |*)
function GetWorkItemData(out pcbData: WORD; out prgbData: PByte): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * pcbData, {out} BYTE ** prgbData |*)
function SetErrorRetryCount(wRetryCount: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD wRetryCount |*)
function GetErrorRetryCount(out pwRetryCount: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * pwRetryCount |*)
function SetErrorRetryInterval(wRetryInterval: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} WORD wRetryInterval |*)
function GetErrorRetryInterval(out pwRetryInterval: WORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} WORD * pwRetryInterval |*)
function SetFlags(dwFlags: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} DWORD dwFlags |*)
function GetFlags(out pdwFlags: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} DWORD * pdwFlags |*)
function SetAccountInformation(pwszAccountName: LPCWSTR; pwszPassword: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszAccountName, {in} LPCWSTR pwszPassword |*)
function GetAccountInformation(out ppwszAccountName: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszAccountName |*)
end;
//+----------------------------------------------------------------------------
//
// Interface: ITask
//
// Synopsis: Task object interface. The primary means of task object
// manipulation.
//
//-----------------------------------------------------------------------------
// {148BD524-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM IID_ITask}
IID_ITask: TIID = (D1: $148BD524; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
// interface ITask;
type
{$EXTERNALSYM ITask}
ITask = interface(IScheduledWorkItem)
['{148BD524-A2AB-11CE-B11F-00AA00530503}']
// Properties that correspond to parameters of CreateProcess:
function SetApplicationName(pwszApplicationName: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszApplicationName |*)
function GetApplicationName(out ppwszApplicationName: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszApplicationName |*)
function SetParameters(pwszParameters: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszParameters |*)
function GetParameters(out ppwszParameters: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszParameters |*)
function SetWorkingDirectory(pwszWorkingDirectory: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszWorkingDirectory |*)
function GetWorkingDirectory(out ppwszWorkingDirectory: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszWorkingDirectory |*)
function SetPriority(dwPriority: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} DWORD dwPriority |*)
function GetPriority(out pdwPriority: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} DWORD * pdwPriority |*)
// Other properties:
function SetTaskFlags(dwFlags: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} DWORD dwFlags |*)
function GetTaskFlags(out pdwFlags: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} DWORD * pdwFlags |*)
function SetMaxRunTime(dwMaxRunTimeMS: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} DWORD dwMaxRunTimeMS |*)
function GetMaxRunTime(out pdwMaxRunTimeMS: DWORD): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} DWORD * pdwMaxRunTimeMS |*)
end;
//+----------------------------------------------------------------------------
//
// Interface: IEnumWorkItems
//
// Synopsis: Work item object enumerator. Enumerates the work item objects
// within the Tasks folder.
//
//-----------------------------------------------------------------------------
// {148BD528-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM IID_IEnumWorkItems}
IID_IEnumWorkItems: TIID = (D1: $148BD528; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
// interface IEnumWorkItems;
type
{$EXTERNALSYM IEnumWorkItems}
IEnumWorkItems = interface(IUnknown)
['{148BD528-A2AB-11CE-B11F-00AA00530503}']
// Methods:
function Next(celt: ULONG; out rgpwszNames: PLPWSTR; out pceltFetched: ULONG): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} ULONG celt, {out} LPWSTR ** rgpwszNames, {out} ULONG * pceltFetched |*)
function Skip(celt: ULONG): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} ULONG celt |*)
function Reset(): HRESULT; stdcall;
function Clone(out ppEnumWorkItems: IEnumWorkItems): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} IEnumWorkItems ** ppEnumWorkItems |*)
end;
//+----------------------------------------------------------------------------
//
// Interface: ITaskScheduler
//
// Synopsis: Task Scheduler interface. Provides location transparent
// manipulation of task and/or queue objects within the Tasks
// folder.
//
//-----------------------------------------------------------------------------
// {148BD527-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM IID_ITaskScheduler}
IID_ITaskScheduler: TIID = (D1: $148BD527; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
// interface ITaskScheduler;
type
{$EXTERNALSYM ITaskScheduler}
ITaskScheduler = interface(IUnknown)
['{148BD527-A2AB-11CE-B11F-00AA00530503}']
// Methods:
function SetTargetComputer(pwszComputer: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszComputer |*)
function GetTargetComputer(out ppwszComputer: LPWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} LPWSTR * ppwszComputer |*)
function Enum(out ppEnumWorkItems: IEnumWorkItems): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {out} IEnumWorkItems ** ppEnumWorkItems |*)
function Activate(pwszName: LPCWSTR; const riid: TIID; out ppUnk: IUnknown): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszName, {in} REFIID riid, {out} IUnknown ** ppUnk |*)
function Delete(pwszName: LPCWSTR): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszName |*)
function NewWorkItem(pwszTaskName: LPCWSTR; const rclsid: TCLSID; const riid: TIID; out ppUnk: IUnknown): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszTaskName, {in} REFCLSID rclsid, {in} REFIID riid, {out} IUnknown ** ppUnk |*)
function AddWorkItem(pwszTaskName: LPCWSTR; const pWorkItem: IScheduledWorkItem): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszTaskName, {in} IScheduledWorkItem * pWorkItem |*)
function IsOfType(pwszName: LPCWSTR; const riid: TIID): HRESULT; stdcall;
(*| Parameter(s) was/were [CPP]: {in} LPCWSTR pwszName, {in} REFIID riid |*)
end;
// EXTERN_C const CLSID CLSID_CTask;
// EXTERN_C const CLSID CLSID_CTaskScheduler;
// {148BD520-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM CLSID_CTask}
CLSID_CTask: TCLSID = (D1: $148BD520; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
// {148BD52A-A2AB-11CE-B11F-00AA00530503}
const
{$EXTERNALSYM CLSID_CTaskScheduler}
CLSID_CTaskScheduler: TCLSID = (D1: $148BD52A; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
//
// NOTE: Definition of HPROPSHEETPAGE is from sdk\inc\prsht.h
// Including this header file causes numerous redefinition errors.
//
type
{$EXTERNALSYM _PSP}
_PSP = record end;
{$IFNDEF FPC}
type
{$EXTERNALSYM HPROPSHEETPAGE}
HPROPSHEETPAGE = ^_PSP;
{$ENDIF ~FPC}
type
{$EXTERNALSYM _TASKPAGE}
_TASKPAGE = (
{$EXTERNALSYM TASKPAGE_TASK}
TASKPAGE_TASK, // 0
{$EXTERNALSYM TASKPAGE_SCHEDULE}
TASKPAGE_SCHEDULE, // 1
{$EXTERNALSYM TASKPAGE_SETTINGS}
TASKPAGE_SETTINGS // 2
);
{$EXTERNALSYM TASKPAGE}
TASKPAGE = _TASKPAGE;
TTaskPage = _TASKPAGE; // OS: Changed capitalization
//+----------------------------------------------------------------------------
//
// Interface: IProvideTaskPage
//
// Synopsis: Task property page retrieval interface. With this interface,
// it is possible to retrieve one or more property pages
// associated with a task object. Task objects inherit this
// interface.
//
//-----------------------------------------------------------------------------
// {4086658a-cbbb-11cf-b604-00c04fd8d565}
const
{$EXTERNALSYM IID_IProvideTaskPage}
IID_IProvideTaskPage: TIID = (D1: $4086658A; D2: $CBBB; D3: $11CF; D4: ($B6, $04, $00, $C0, $4F, $D8, $D5, $65));
// interface IProvideTaskPage;
type
{$EXTERNALSYM IProvideTaskPage}
IProvideTaskPage = interface(IUnknown)
['{4086658A-CBBB-11CF-B604-00C04FD8D565}']
// Methods:
function GetPage(tpType: TTaskPage; fPersistChanges: BOOL; out phPage: HPROPSHEETPAGE): HRESULT; stdcall; // OS: Changed TASKPAGE to TTaskPage
(*| Parameter(s) was/were [CPP]: {in} TASKPAGE tpType, {in} BOOL fPersistChanges, {out} HPROPSHEETPAGE * phPage |*)
end;
type
{$EXTERNALSYM ISchedulingAgent}
ISchedulingAgent = ITaskScheduler;
type
{$EXTERNALSYM IEnumTasks}
IEnumTasks = IEnumWorkItems;
const
{$EXTERNALSYM IID_ISchedulingAgent}
IID_ISchedulingAgent: TIID = (D1: $148BD527; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
const
{$EXTERNALSYM CLSID_CSchedulingAgent}
CLSID_CSchedulingAgent: TCLSID = (D1: $148BD52A; D2: $A2AB; D3: $11CE; D4: ($B1, $1F, $00, $AA, $00, $53, $05, $03));
//DOM-IGNORE-END
{$IFDEF UNITVERSIONING}
const
UnitVersioning: TUnitVersionInfo = (
RCSfile: '$URL$';
Revision: '$Revision$';
Date: '$Date$';
LogPath: 'JCL\source\windows';
Extra: '';
Data: nil
);
{$ENDIF UNITVERSIONING}
implementation
{$IFDEF UNITVERSIONING}
initialization
RegisterUnitVersion(HInstance, UnitVersioning);
finalization
UnregisterUnitVersion(HInstance);
{$ENDIF UNITVERSIONING}
end.