Retrieving a Task Page Example

To retrieve a task page you must call ITask::QueryInterface to retrieve the IProvideTaskPage interface, then call IProvideTaskPage::GetPage. The GetPage method returns a handle to the page, which can then be used to display the page you requested.


In the following code example, all interfaces are released after they are no longer needed.


The following procedure describes how to create a new trigger.

To create a new trigger

  1. Call CoInitialize to initialize the COM library and CoCreateInstance to get a Task Scheduler object. (This example assumes that the Task Scheduler service is running.)
  2. Call ITaskScheduler::Activate to get the ITask interface of the task object. (Note that this example gets the "Test Task" task.)
  3. Call ITask::QueryInterface to retrieve the IProvideTaskPage interface and IProvideTaskPage::GetPage to retrieve the page.
  4. Using the returned page handle, display the page.
For a code example of See
Retrieving and displaying the Task page of a known task Retrieving a Task Page


Task Scheduler 1.0 Examples