public static void KillInactivePuttyWindows()
 {
     var puttyBadWindows = new List<IntPtr>();
     WinApi.EnumWindows(delegate(IntPtr childHwnd, int lparam)
                            {
                                var text = new PuttyWindow(childHwnd).Text;
                                if (text == @"PuTTY Fatal Error")
                                {
                                    puttyBadWindows.Add(WinApi.GetParent(childHwnd));
                                }
                                return true;
                            }, 0);
     killPutties(puttyBadWindows);
 }
        public static IEnumerable <PuttyWindow> GetPuttyWindows()
        {
            var puttyWindows = new List <PuttyWindow>();

            WinApi.EnumWindows((hwnd, lParam) =>
            {
                var window = new PuttyWindow(hwnd);
                if (window.ClassName == PuttyClassName || window.Text == PuttyWindow.ConfigurationWindowText)
                {
                    puttyWindows.Add(window);
                }
                return(true);
            }, 0);
            return(puttyWindows);
        }
        public static void KillInactivePuttyWindows()
        {
            var puttyBadWindows = new List <IntPtr>();

            WinApi.EnumWindows(delegate(IntPtr childHwnd, int lparam)
            {
                var text = new PuttyWindow(childHwnd).Text;
                if (text == @"PuTTY Fatal Error")
                {
                    puttyBadWindows.Add(WinApi.GetParent(childHwnd));
                }
                return(true);
            }, 0);
            killPutties(puttyBadWindows);
        }
 public static IEnumerable<PuttyWindow> GetPuttyWindows()
 {
     var puttyWindows = new List<PuttyWindow>();
     WinApi.EnumWindows((hwnd, lParam) =>
                            {
                                var window = new PuttyWindow(hwnd);
                                if (window.ClassName == PuttyClassName || window.Text == PuttyWindow.ConfigurationWindowText)
                                {
                                    puttyWindows.Add(window);
                                }
                                return true;
                            }, 0);
     return puttyWindows;
 }