ITask interface (mstask.h)

[[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.

Inheritance

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

Methods

The ITask interface has these methods.

 
ITask::GetApplicationName

This method retrieves the name of the application that the task is associated with.
ITask::GetMaxRunTime

This method retrieves the maximum length of time, in milliseconds, the task can run before terminating.
ITask::GetParameters

This method retrieves the task's command-line parameters.
ITask::GetPriority

This method retrieves the priority for the task.
ITask::GetTaskFlags

This method returns the flags that modify the behavior of a task.
ITask::GetWorkingDirectory

This method retrieves the task'sworking directory.
ITask::SetApplicationName

This method assigns a specific application to the current task.
ITask::SetMaxRunTime

This method sets the maximum time the task can run, in milliseconds, before terminating.
ITask::SetParameters

This method sets the command-line parameters for the task.
ITask::SetPriority

This method sets the priority for the task.
ITask::SetTaskFlags

This method sets the flags that modify the behavior of a scheduled task.
ITask::SetWorkingDirectory

This method sets the working directory for the task.

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

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mstask.h
Redistributable Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95

See also

IScheduledWorkItem

ITaskScheduler::Activate

ITaskScheduler::NewWorkItem