System.Diagonistics.Process.GetProcesses() on a hyper-threading (possibly true multi-proc) computer running Windows 2000 fails with: "Couldn't get process information from remote machine ---> System.ArgumentOutOfRangeException: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks." The same error can occur if your registry key HKEY_LOCAL_MACHINE.Software.Microsoft.WindowNT.CurrentVersion.PerfLib is corrupted. The solution for this problem is to get process information using win32 API.
Using the code
This Win32 API implementation project consists of one key file: Processes.cs which implements the Win32 functions for Process List, Process IDs, and killing a process by process ID. An example project is also included in the source code that demonstrates the basic usage of the
Simply build and run the project, you will see a Windows form that has a listbox loading all system processes. You can select any process and just click the KILL button, and the selected process will be killed by using the Win32 API implementation.
private void btnKill_Click(object sender, System.EventArgs e)
MessageBox.Show("Process is killed successfully");
MessageBox.Show("Process cannot be Killed");
public static bool Kill(uint uiProcessId)
- Initial release - 8th November 2006.