ITaskScheduler (Interfaces)
Last changed: -81.149.190.75

.
Summary
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_ITaskScheduler = new Guid("148BD52A-A2AB-11CE-B11F-00AA00530503");

    static public ITaskScheduler CreateTaskScheduler()
    {
    Type obj = Type.GetTypeFromCLSID(CLSID_ITaskScheduler, 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
   TODO
End Interface

User-Defined Types:

None.

Notes:

None.

Alternative managed API:

http://www.codeproject.com/KB/cs/tsnewlib.aspx

Documentation