public static bool GetProcessRect(System.Diagnostics.Process process, ref Rect rect) { IntPtr[] winPtrs = WindowsUtil.GetProcessWindows(process.Id); for (int i = 0; i < winPtrs.Length; i++) { bool gotRect = WindowsUtil.GetWindowRect(winPtrs[i], ref rect); if (gotRect && (rect.Left != 0 && rect.Top != 0)) { return(true); } } return(false); }