Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Process.Threads Property

Gets the set of threads that are running in the associated process.

[Visual Basic]
Public ReadOnly Property Threads As ProcessThreadCollection
[C#]
public ProcessThreadCollection Threads {get;}
[C++]
public: __property ProcessThreadCollection* get_Threads();
[JScript]
public function get Threads() : ProcessThreadCollection;

Property Value

An array of type ProcessThread representing the operating system threads currently running in the associated process.

Exceptions

Exception Type Condition
SystemException The process does not have an Id, or no process is associated with the Process instance.

-or-

The associated process has exited.

Remarks

A thread executes code in a process. Each process is started with a single thread, its primary thread. Any thread can create additional threads. Threads within a process share the address space of the process.

Use ProcessThread to get all the threads associated with the current process. The primary thread is not necessarily at index zero in the array.

Windows 98 Platform Note:  This property is not available on this platform if you started the process with ProcessStartInfo.UseShellExecute set to true.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Process Class | Process Members | System.Diagnostics Namespace | ProcessThread | BasePriority

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.