I am trying to get all running MS Word processes, but it always returns 1
.
How I can get the exact number of processes? I do have more than one file open.
Process[] localByName = Process.GetProcessesByName("WINWORD");
foreach (Process p in localByName)
{
if (!String.IsNullOrEmpty(p.MainWindowTitle))
{
Rect NotepadRect = new Rect();
IntPtr ptr = p.MainWindowHandle;
GetWindowRect(ptr, ref NotepadRect);
objSchemeDetail.Top = NotepadRect.Top;
objSchemeDetail.Bottom = NotepadRect.Bottom;
objSchemeDetail.Left = NotepadRect.Left;
objSchemeDetail.Right = NotepadRect.Right;
}
}