public static Window window(this API_GuiAutomation guiAutomation, string windowName)
 {
     if (guiAutomation.notNull())
     {
         foreach (var window in guiAutomation.windows())
         {
             if (window.Name == windowName)
             {
                 return(window);
             }
         }
     }
     return(null);
 }
 public static List <Window> windows(this API_GuiAutomation guiAutomation)
 {
     try
     {
         if (guiAutomation.notNull() && guiAutomation.Application.notNull())
         {
             return(guiAutomation.Application.GetWindows());
         }
     }
     catch (Exception ex)
     {
         ex.log();
     }
     return(new List <Window>());                        // do a soft landing
 }