GetCurrentProcess (kernel32)
Last changed: -165.214.12.68

.
Summary
Returns a pseudo handle for the current process.

C# Signature:

[DllImport("kernel32.dll")]
static extern IntPtr GetCurrentProcess();

VB Signature:

Declare Function GetCurrentProcess Lib "kernel32.dll" () As IntPtr

Notes:

With Version 2.0 of the .NET Framework, SafeWaitHandle is recommended as the return type in place of IntPtr. SafeWaitHandle is one of many types derived from the SafeHandle abstract class, which did not exist before Version 2.0. SafeWaitHandle is publicly exposed and is in the Microsoft.Win32.SafeHandles namespace.

Tips & Tricks:

Please add some!

Sample Code:

IntPtr hproc = GetCurrentProcess();

Alternative Managed API:

System.Diagnostics.Process.GetCurrentProcess

Documentation