Querying Existing Processes
You can easily get information on running processes through some methods from the Process class that provide the ability of getting process instances. For example, GetProcesses returns an array of Process objects, each one representing a running process whereas GetProcessById and GetProcessByName return information on the specified process given the identification number or name, whereas GetCurrentProcess returns an instance of the Process class representing the current process. Then the Process class exposes lots of useful properties for retrieving information, each of them self-explanatory such as ProcessName, Id, ExitCode, Handle, or HasExited but also other advanced information properties, such as PageMemorySize ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access