I am trying to retrieve process information and I'm aware that I can use:
Process[] myProcesses = Process.GetProcesses();
but how do I retrieve the process description? Is it via some Win32 API call? I'm running Vista and when I click under the Processes tab in Task Manager, I see the description.
What you see in Task Manager is actually the Description field of the executable image.
You can use the GetFileVersionInfo()
and VerQueryValue()
WinAPI calls to access various version informations, e.g. CompanyName or FileDescription.
For .Net way, use the FileDescription
member of FileVersionInfo
, instantiated with the executable name got via Process.MainModule.FileName
.
Another way would be through Assembly
. Load the Assembly from the executable image, then query the AssemblyDescriptionAttribute
custom attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With