[Mono-list] Re: Windows processes
Alex Nedelcu
bonefry at gmail.com
Fri Jun 16 20:28:48 EDT 2006
Err ... replying to myself.
I had a revelation ... what if I look at how Mono has implemented it.
So I happily navigate to the System.Diagnostics.Process implementation
<http://svn.myrealbox.com/viewcvs/trunk/mcs/class/System/System.Diagnostics/Process.cs?rev=60744&view=markup>
and what do I get ?
[MethodImplAttribute(MethodImplOptions.InternalCall)]
*private* *extern* *static* *int* GetPid_internal();
[MethodImplAttribute(MethodImplOptions.InternalCall)]
*private* *extern* *static* *int*[] GetProcesses_internal();
Damn, I thought I had it easy.
What the hell does MethodImplOptions.InternalCall mean ?
Does it mean that the CLR takes care of it ?
So, can you please help me ?
I am not a good C++ programmer to search for code snippets that other
people wrote.
Alex Nedelcu wrote:
> Hi guys,
>
> I want to get the list of processes loaded on Windows, at a given
> time, along with statistics like
> cpu usage, memory usage, etc ...
>
> Although it is for a C# project, I do not want a C#-specific solution
> (like System.Diagnostics and stuff).
>
> I also know about WMI, but besides the fact that MONO doesn't support
> WMI yet (AFAIK),
> for other reasons I do not want to use WMI.
>
> So ... any other way ?
> Any COM objects I could call ?
> Any Windows functions from kernel32.dll, or user32.dll ?
>
>
> Please help me, because I am unfamiliar with the Win32API ... and
> believe me that I searched, and with no success.
>
>
> Thank you,
>
More information about the Mono-list
mailing list