Returns a new Process component and associates it with the current active process.
[Visual Basic] Public Shared Function GetCurrentProcess() As Process [C#] public static Process GetCurrentProcess(); [C++] public: static Process* GetCurrentProcess(); [JScript] public static function GetCurrentProcess() : Process;
A new Process component that is associated with the process resource running the calling application.
Use this method to create a new Process component and associate it with the active process resource on the local computer. Like the similar GetProcessById, GetProcessesByName, and GetProcesses methods, GetCurrentProcess does not create a new process resource; it only associates an existing resource with a new application-defined Process component.
Because the GetCurrentProcess method is static (in Visual Basic Shared), you do not need to create an instance of the Process component before you call the method. You can call the method on the Process class itself.
Process Class | Process Members | System.Diagnostics Namespace | GetProcessById | GetProcessesByName | GetProcesses