GetProcessHandleCount (kernel32)
Last changed: Adam Adorjan-67.17.241.132

.
Summary
Retrieves the number of open handles that belong to the specified process.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true)]
static extern bool GetProcessHandleCount(IntPtr hProcess, ref UInt32 dwHandleCount);

User-Defined Types:

None.

Alternative Managed API:

Process.HandleCount Property

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

UInt32 handles = 0;

GetProcessHandleCount(Process.GetCurrentProcess().Handle, ref handles);

Console.Write("HANDLE: " + handles);

Documentation