简体   繁体   中英

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

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 the 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM