proc.MainWindowTitle.Contains("e")
How does one get the window titles of all the current windows containing "e" open instead of just the Main Window using the "MainWindowTitle" and store them into a string array?
EDIT:
string[] toClose = {proc.MainWindowTitle};
for (int i = 0; i < toClose.Length; i++)
{
string s = toClose[i];
int hwnd = 0;
hwnd = FindWindow(null, s);
//send WM_CLOSE system message
if (hwnd != 0)
SendMessage(hwnd, WM_CLOSE, 0, IntPtr.Zero);
See Question&Answers more detail:os