babu
New member
- Joined
- Jun 16, 2020
- Messages
- 3
- Programming Experience
- 1-3
Team,
NtProcessManager, ProcessManager throws below errors
Not enough memory resources are available to process this command
Exception of type System.OutOfMemoryException was thrown.
And came to know it was thrown from ProcessManager. System.Diagnostics.Process.cs. Please let me know why I am getting error, and how to optimize the code
NtProcessManager, ProcessManager throws below errors
Not enough memory resources are available to process this command
Exception of type System.OutOfMemoryException was thrown.
And came to know it was thrown from ProcessManager. System.Diagnostics.Process.cs. Please let me know why I am getting error, and how to optimize the code
Get Process having Window:
IEnumerable<Process> processes = Process.GetProcesses()
.Where(p => (long)p.MainWindowHandle != 0
&& p.MainWindowTitle.Length > 0
&& (p.StartInfo.WindowStyle == ProcessWindowStyle.Maximized
|| p.StartInfo.WindowStyle == ProcessWindowStyle.Normal)
);