IRunningTask::State property

Gets an identifier for the state of the running task.

This property is read-only.

Syntax


HRESULT get_State(
  [out] TASK_STATE *pState
);

Property value

An identifier for the state of the running task.

ValueMeaning
TASK_STATE_UNKNOWN
0

The state of the task is unknown.

TASK_STATE_DISABLED
1

The task is registered but is disabled and no instances of the task are queued or running. The task cannot be run until it is enabled.

TASK_STATE_QUEUED
2

Instances of the task are queued.

TASK_STATE_READY
3

The task is ready to be executed, but no instances are queued or running.

TASK_STATE_RUNNING
4

One or more instances of the task are running.

 

Error codes

NameMeaning
S_OK

The property value was successfully retrieved.

E_POINTER

A NULL value was passed into the pState parameter.

Remarks

The IRunningTask::Refresh method is called before the property value is returned.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Taskschd.h

Library

Taskschd.lib

DLL

Taskschd.dll

See also

IRunningTask

 

 

Show: