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()andVerQueryValue()WinAPI calls to access various version informations, e.g. CompanyName or FileDescription.For .Net way, use the
FileDescriptionmember ofFileVersionInfo, instantiated with the executable name got viaProcess.MainModule.FileName.Another way would be through
Assembly. Load the Assembly from the executable image, then query theAssemblyDescriptionAttributecustom attribute.