public bool WaitForWindow(string title, int timeOut) { DateTime start = DateTime.Now; while (!IsWinExists(title) && (DateTime.Now - start).TotalMilliseconds < timeOut) ; return (DateTime.Now - start).TotalMilliseconds < timeOut; }