ITaskScheduler (Interfaces)
Last changed: -

Part of the Task Scheduler 1.0 Interfaces, which consists of IEnumWorkItems, ITask, ITaskScheduler, ITaskTrigger and IScheduledWorkItem. There is some helper code below. Not all methods have been tested, so be careful!

C# Definition:

    [Guid("148BD527-A2AB-11CE-B11F-00AA00530503"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface ITaskScheduler
    int SetTargetComputer(  [MarshalAs(UnmanagedType.LPWStr)]   string      computer);
    int GetTargetComputer(  [MarshalAs(UnmanagedType.LPWStr)]   out string  computer);
    int Enum(           [MarshalAs(UnmanagedType.IUnknown)] out object  enumworkitems);
    int Activate(       [MarshalAs(UnmanagedType.LPWStr)]   string      name,
                                    ref Guid    riid,
                [MarshalAs(UnmanagedType.IUnknown)] out object  obj);
    int Delete(         [MarshalAs(UnmanagedType.LPWStr)]   string      name);
    int NewWorkItem(    [MarshalAs(UnmanagedType.LPWStr)]   string      name,
                                    ref Guid    rclsid,
                                    ref Guid    riid,
                [MarshalAs(UnmanagedType.IUnknown)] out object  obj);
    int AddWorkItem(    [MarshalAs(UnmanagedType.LPWStr)]   string      name,
                [MarshalAs(UnmanagedType.IUnknown)] object      obj);
    int IsOfType(       [MarshalAs(UnmanagedType.LPWStr)]   string      name,
                                    ref Guid    riid);

C# Helper Code

    using System;
    using System.Runtime.InteropServices;

    static public Guid CLSID_TaskScheduler = new Guid("148BD52A-A2AB-11CE-B11F-00AA00530503");

    static public ITaskScheduler CreateTaskScheduler()
    Type obj = Type.GetTypeFromCLSID(CLSID_TaskScheduler, true);
    return Activator.CreateInstance(obj) as ITaskScheduler;

VB Definition:

<ComImport> _
<Guid("TODO")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface ITaskScheduler
End Interface

User-Defined Types:




Alternative managed API:

Managed wrapper library for all Task Scheduler 1.0 and 2.0 interfaces: