ITask interface

[[This API may be altered or unavailable in subsequent versions of the operating system or product. Please use the Task Scheduler 2.0 Interfaces instead.] ]

Provides the methods for running tasks, getting or setting task information, and terminating tasks. It is derived from the IScheduledWorkItem interface and inherits all the methods of that interface.

Members

The ITask interface inherits from IScheduledWorkItem. ITask also has these types of members:

Methods

The ITask interface has these methods.

MethodDescription
CreateTrigger

Creates a trigger using a work item object.

DeleteTrigger

Deletes a trigger from a work item.

EditWorkItem

Opens the configuration properties for the work item.

GetAccountInformation

Retrieves the account name for the work item.

GetApplicationName

Retrieves the name of the application that the task is associated with.

GetComment

Retrieves the comment for the work item.

GetCreator

Retrieves the creator of the work item.

GetErrorRetryCount

Not currently implemented.

GetErrorRetryInterval

Not currently implemented.

GetExitCode

Retrieves the work item's last exit code.

GetFlags

Retrieves the flags that modify the behavior of the work item.

GetIdleWait

Retrieves the idle wait time for the work item.

GetMaxRunTime

Retrieves the maximum length of time the task can run.

GetMostRecentRunTime

Retrieves the most recent time the work item began running.

GetNextRunTime

Retrieves the next time the work item will run.

GetParameters

Retrieves the command-line parameters of a task.

GetPriority

Retrieves the priority for the task.

GetRunTimes

Retrieves the work item run times for a specified time period.

GetStatus

Retrieves the status of the work item.

GetTaskFlags

Returns the flags used to modify the behavior of the task.

GetTrigger

Retrieves a trigger structure.

GetTriggerCount

Retrieves the number of triggers associated with a work item.

GetTriggerString

Retrieves a trigger string.

GetWorkingDirectory

Retrieves the working directory of the task.

GetWorkItemData

Retrieves application-defined data associated with the work item.

Run

Runs the work item.

SetAccountInformation

Sets the account name and password for the work item.

SetApplicationName

Assigns a specific application to the current task.

SetComment

Sets the comment for the work item.

SetCreator

Sets the creator of the work item.

SetErrorRetryCount

Not currently implemented.

SetErrorRetryInterval

Not currently implemented.

SetFlags

Sets the flags that modify the behavior of the work item.

SetIdleWait

Sets the idle wait time for the work item.

SetMaxRunTime

Sets the maximum length of time the task can run.

SetParameters

Sets the command-line parameters for the task.

SetPriority

Sets the priority for the task.

SetTaskFlags

Sets the flags that modify the behavior of the task.

SetWorkingDirectory

Sets the working directory for the task.

SetWorkItemData

Stores application-defined data associated with the work item.

Terminate

Ends the execution of the work item.

 

Remarks

ITask is the primary interface of the task trigger object. To create a task object, call ITaskScheduler::Activate for existing tasks or ITaskScheduler::NewWorkItem for new tasks.

Examples

For more information and example code for this interface, see C/C++ Code Example: Terminating a Task.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95

Header

Mstask.h

Library

Mstask.lib

DLL

Mstask.dll

See also

IScheduledWorkItem
ITaskScheduler::Activate
ITaskScheduler::NewWorkItem

 

 

Show: