Question

I need to be able to implement the IRunnableTask interface, and have no idea how. I tried adding reference to C:\Windows\System32\Shell32.dll -- no luck... google to try and find information... nothing around how to import/include in a .net project to access IRunnableTask.

I'm sure this is an easy one for someone that has used this interface before.

Was it helpful?

Solution

That interface is part of the Windows SDK. Referencing is not as straight forward as a normal .NET reference. You need to declare it with a COM import like this:

using System.Runtime.InteropServices;

namespace Your.Namespace
{
    [ComImport]
    [Guid("85788D00-6807-11D0-B810-00C04FD706EC")]
    interface IRunnableTask
    {
        int IsRunning();
        uint Kill(bool fUnused);
        uint Resume();
        uint Run();
        uint Suspend();
    }

    class RunnableTaskImpl : IRunnableTask
    {
        public int IsRunning() { return 0; }
        public uint Kill(bool fUnused) { return 0; }
        public uint Resume() { return 0; }
        public uint Run() { return 0; }
        public uint Suspend() { return 0; }
    } 
}

Are you sure you need to implement that interface?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top