Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

IScheduledWorkItem (Interfaces)
 
.
Summary
Part of the Task Scheduler 1.0 Interfaces, which consists of IEnumWorkItems, ITask, ITaskScheduler, ITaskTrigger and IScheduledWorkItem. Generally this is useless - use ITask (which inherits from IScheduledWorkItem) instead. Not all methods have been tested, so be careful!

C# Definition:

    [Guid("a6b952f0-a4b1-11d0-997d-00aa006887ec"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IScheduledWorkItem
    {
    int CreateTrigger(                      out ushort  iTrigger,
                [MarshalAs(UnmanagedType.IUnknown)] out object  trigger);
    int DeleteTrigger(                      ushort      iTrigger);
    int GetTriggerCount(                    out ushort  iTriggerCount);
    int GetTrigger(                     ushort      iTrigger,
                [MarshalAs(UnmanagedType.IUnknown)] out object  trigger);

    int GetTriggerString(                   ushort      iTrigger,
                [MarshalAs(UnmanagedType.LPWStr)]   out string  trigger);

    int GetRunTimes(                    ref SYSTEMTIME pstBegin,
                                ref SYSTEMTIME pstEnd,
                                out ushort     count,
                                out SYSTEMTIME rgstTaskTimes);

    int GetNextRunTime(                     ref SYSTEMTIME pstNextRun);
    int SetIdleWait(                    ushort     wIdleMinutes,
                                ushort     wDeadlineMinutes);
    int GetIdleWait(                    out ushort     wIdleMinutes,
                                out ushort     wDeadlineMinutes);
    int Run();
    int Terminate( );
    int EditWorkItem(                       IntPtr     hParent,
                                uint       dwReserved);
    int GetMostRecentRunTime(                   out SYSTEMTIME pstLastRun);
    int GetStatus(                      out uint       hrStatus);  //uses WORK_ITEM_STATUS
    int GetStatus(                      out uint       hrStatus);  //uses SCHED_S_TASK_XXX values
    int GetExitCode(                    out uint       dwExitCode);
    int SetComment(       [MarshalAs(UnmanagedType.LPWStr)] string     Comment);
    int GetComment(       [MarshalAs(UnmanagedType.LPWStr)] out string     Comment);
    int SetCreator(       [MarshalAs(UnmanagedType.LPWStr)] string     Creator);
    int GetCreator(       [MarshalAs(UnmanagedType.LPWStr)] out string     Creator);
    int SetWorkItemData(  ushort cbData,    Byte[] rgbData);
    int GetWorkItemData(  out ushort cbData,out Byte[] rgbData);
    int SetErrorRetryCount( ushort wRetryCount);
    int GetErrorRetryCount( out ushort wRetryCount);
    int SetErrorRetryInterval( ushort wRetryInterval);
    int GetErrorRetryInterval( out ushort wRetryInterval);
    int SetFlags( uint dwFlags);       // uses TASK_FLAGS
    int GetFlags(out uint dwFlags);    // uses TASK_FLAGS
    int SetAccountInformation( [MarshalAs(UnmanagedType.LPWStr)] string AccountName,
                   [MarshalAs(UnmanagedType.LPWStr)] string PassUInt16);
    int GetAccountInformation( [MarshalAs(UnmanagedType.LPWStr)] out string AccountName);
    };

    [Flags]
    public enum TASK_FLAGS
    {
    TASK_FLAG_INTERACTIVE          = 0x1,
    TASK_FLAG_DELETE_WHEN_DONE         = 0x2,
    TASK_FLAG_DISABLED             = 0x4,
    TASK_FLAG_START_ONLY_IF_IDLE       = 0x10,
    TASK_FLAG_KILL_ON_IDLE_END         = 0x20,
    TASK_FLAG_DONT_START_IF_ON_BATTERIES   = 0x40,
    TASK_FLAG_KILL_IF_GOING_ON_BATTERIES   = 0x80,
    TASK_FLAG_RUN_ONLY_IF_DOCKED       = 0x100,
    TASK_FLAG_HIDDEN               = 0x200,
    TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET = 0x400,
    TASK_FLAG_RESTART_ON_IDLE_RESUME       = 0x800,
    TASK_FLAG_SYSTEM_REQUIRED          = 0x1000,
    TASK_FLAG_RUN_ONLY_IF_LOGGED_ON    = 0x2000,
    }

    public enum WORK_ITEM_STATUS
    {
    SCHED_S_TASK_READY         = 0x00041300,
    SCHED_S_TASK_RUNNING       = 0x00041301,
    SCHED_S_TASK_DISABLED      = 0x00041302,
    SCHED_S_TASK_HAS_NOT_RUN       = 0x00041303,
    SCHED_S_TASK_NO_MORE_RUNS      = 0x00041304,
    SCHED_S_TASK_NOT_SCHEDULED     = 0x00041305,
    SCHED_S_TASK_TERMINATED    = 0x00041306,
    SCHED_S_TASK_NO_VALID_TRIGGERS = 0x00041307,
    }

VB Definition:

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

User-Defined Types:

None.

Notes:

None.

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions