Ағылшын тілінде оқу

Бөлісу құралы:


IShellTaskScheduler2::AddTask2 method

[IShellTaskScheduler2 is available in Windows XP. It might be altered or unavailable in subsequent versions.]

Adds a task to the scheduler's background queue.

Syntax

c++
HRESULT AddTask2(
  [in] IRunnableTask  *pTask,
  [in] REFTASKOWNERID rtoid,
  [in] DWORD_PTR      lParam,
  [in] DWORD          dwPriority,
  [in] DWORD          grfFlags
);

Parameters

pTask [in]

Type: IRunnableTask*

A pointer to an instance of an IRunnableTask interface representing the task to add to the queue.

rtoid [in]

Type: REFTASKOWNERID

A GUID identifying the owner of the task. This information can be used to group tasks for later counting or removal by owner.

lParam [in]

Type: DWORD_PTR

A pointer to a user-defined DWORD value allowing the task to be identified within the tasks owned by rtoid. This is used to identify single tasks or to subgroup them, for example associating the task with a particular item such as an item in a ListView. This parameter can be zero.

dwPriority [in]

Type: DWORD

One of the following values assigning the task's priority. Response to this priority depends on the cooperation of the other tasks being executed. New tasks are inserted in the queue in priority order. If a task of a low priority is currently under execution when a higher priority task is added, the scheduler attempts to suspend the task under execution. That lower priority task is resumed when the higher priority task(s) are completed.

ITSAT_DEFAULT_PRIORITY

Accept the default priority assigned to the task by the scheduler.

ITSAT_MAX_PRIORITY

High priority.

ITSAT_MIN_PRIORITY

Low priority.

grfFlags [in]

Type: DWORD

One of the following values indicating the placement of the task in the queue with respect to other tasks of its priority level.

ITSSFLAG_TASK_PLACEINFRONT

Place the task in front of other tasks at the same priority level.

ITSSFLAG_TASK_PLACEINBACK

Place the task behind other tasks at the same priority level.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

DLL

Shell32.dll (version 5.0 or later)