ITaskFolder::GetTasks method (taskschd.h)

Gets all the tasks in the folder.

Syntax

HRESULT GetTasks(
  [in]  LONG                      flags,
  [out] IRegisteredTaskCollection **ppTasks
);

Parameters

[in] flags

Specifies whether to retrieve hidden tasks. Pass in TASK_ENUM_HIDDEN to retrieve all tasks in the folder including hidden tasks, and pass in 0 to retrieve all the tasks in the folder excluding the hidden tasks.

[out] ppTasks

An IRegisteredTaskCollection collection of all the tasks in the folder.

Pass in a reference to a NULL IRegisteredTaskCollection interface pointer. Referencing a non-NULL pointer can cause a memory leak because the pointer will be overwritten.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h
Library Taskschd.lib
DLL Taskschd.dll

See also

ITaskFolder

Task Scheduler