public static IDictionary <IntPtr, string> GetOpenWindows()
 {
     try
     {
         IntPtr lShellWindow = SEBWindowHandler.GetShellWindow();
         Dictionary <IntPtr, string> lWindows = new Dictionary <IntPtr, string>();
         SEBWindowHandler.EnumWindows((SEBWindowHandler.EnumWindowsProc)((hWnd, lParam) =>
         {
             if (hWnd == lShellWindow || !SEBWindowHandler.IsWindowVisible(hWnd))
             {
                 return(true);
             }
             int windowTextLength = SEBWindowHandler.GetWindowTextLength(hWnd);
             if (windowTextLength == 0)
             {
                 return(true);
             }
             StringBuilder text = new StringBuilder(windowTextLength);
             SEBWindowHandler.GetWindowText(hWnd, text, windowTextLength + 1);
             lWindows[hWnd] = text.ToString().ToLower();
             return(true);
         }), 0);
         return((IDictionary <IntPtr, string>)lWindows);
     }
     catch (Exception ex)
     {
         Logger.AddError("Unable to retrieve open windows", (object)null, ex, (string)null);
         return((IDictionary <IntPtr, string>) new Dictionary <IntPtr, string>());
     }
 }