Click here to Skip to main content
15,886,806 members
Articles / Mobile Apps / Windows Mobile

Task Manager for Windows Mobile and Windows CE

Rate me:
Please Sign up or sign in to vote.
4.51/5 (23 votes)
30 Nov 2008CPOL10 min read 112.3K   7.3K   79  
Source code for writing your own Task Manager for Windows Mobile or Windows CE based devices
import "oaidl.idl";
import "ocidl.idl";

[
	object,
	uuid(1AE828A9-6979-4f4b-8537-D5D6867222EB),
	dual,
	nonextensible,
	helpstring("IProcess Interface"),
	pointer_default(unique)
]
interface IProcess : IDispatch
{
    [propget, id(1), helpstring("Name of the process.")] 
        HRESULT Name([out, retval] BSTR *value);
    [propget, id(2), helpstring("Id of the process.")] 
        HRESULT Pid([out, retval] LONG *value);
    [propget, id(3), helpstring("Number of threads owned by process.")] 
        HRESULT ThreadCount([out, retval] LONG *value);
    [propget, id(4), helpstring("Process base address.")] 
        HRESULT BaseAddress([out, retval] LONG *value);
    [propget, id(5), helpstring("Process heap size.")] 
        HRESULT HeapSize([out, retval] LONG *value);
    [propget, id(6), helpstring("Process virtual memory.")] 
        HRESULT VirtualMemory([out, retval] LONG *value);
    [propget, id(7), helpstring("Process virtual memory committed.")] 
        HRESULT VirtualMemoryCommitted([out, retval] LONG *value);
    [propget, id(8), helpstring("Process virtual memory reserved.")] 
        HRESULT VirtualMemoryReserved([out, retval] LONG *value);
    [propget, id(9), helpstring("Process Dll's.")] 
        HRESULT DllCount([out, retval] LONG *value);
};

[
	object,
	uuid(CD73DB4D-192C-41ab-86DC-E8835756B159),
	dual,
	nonextensible,
	helpstring("IProcessList Interface"),
	pointer_default(unique)
]
interface IProcessList : IDispatch
{
    [id(1), helpstring("Update the process list")]
        HRESULT Update([out, retval] VARIANT_BOOL *value);
    [propget, id(2), helpstring("Number of processes in list.")] 
        HRESULT Count([out, retval] LONG *value);
    [id(DISPID_VALUE), helpstring("Return a IProcess from the list.")] 
        HRESULT Item([in] VARIANT index, [out, retval] IProcess** retval);
    [propget, restricted, id(DISPID_NEWENUM), helpstring("Return an enumeration object that holds all processes.")]
        HRESULT _NewEnum([out, retval] IUnknown** retval);
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Belgium Belgium
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions