-1

There is a Task Manager alternative called "ProcessHacker". With that you can check if a Handle is active and running. enter image description here

I would like to add something like that into my C# program, searching for a specific Handle and if Handle exist do smth...

Is there a reference, nuget or smth I can use?

Thanks for any help :)

Yuuta
  • 43
  • 6

1 Answers1

2
var process = Process.GetProcesses().Where(p => p.Handle.ToInt32() == 0x3b4);

As Matthew Watson noted:

var process = Process.GetProcessById(0x3b4);

would directly get that process with handle. Former's result is an IEnumerable.

Cetin Basoz
  • 22,495
  • 3
  • 31
  • 39