You could use EnumWindows with p/Invoke, but using the static Process.GetProcesses() found in the System.Diagnostics namespace will avoid the interop overhead.
There is one potential problem on Windows 98. If a process was started with ProcessStartInfo.UseShellExecute set to true, this MainWindowHandle is not available.