Getting basic process information is possible from C#, see example here:
Process.GetCurrentProcess Method (System.Diagnostics)[
^]
If you want more, you will need C / C++, see example here:
Process viewer[
^]
Another option would be to use
Sysmon by SysInternals, this is a free tool that logs to the Windows Eventlog. Your program could monitor the Eventlog which is possible from C#. Download Sysmon here:
Sysmon[
^]
Old Sysinternals source code (before it was acquired by Microsoft) can be found here:
GitHub - xcud/sysinternals-source[
^]