开发者

how to find all application/Thread running in a process in windows application in c#?

开发者 https://www.devze.com 2022-12-25 17:09 出处:网络
i want to get list of all application or Threads attached with a process.For example when we open different window all run with explorer.exe or we open different window of mozila all are in firefox.ex

i want to get list of all application or Threads attached with a process.For example when we open different window all run with explorer.exe or we open different window of mozila all are in firefox.exe. i have to check that if a window is all ready open no need to open this.and if it is in background or minimized then then activate th开发者_如何学JAVAe window.


To get all processes

      Process.GetProcesses();

or

       Process.GetProcessByName("Name"); //To get a process

or

        Process.GetCurrentProcess()  //To Get the current running process

Once you get your process you have an attribute called Threads.

Is that what you are looking for?

Once you get the Process you can use ProcessName and once you get the ProcessThread you can use ID.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号