diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index b83bda8d9..1f788d3cd 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -653,7 +653,7 @@ namespace Greenshot { return; } try { - List> tabs = IECaptureHelper.GetTabList(); + List> tabs = IECaptureHelper.GetBrowserTabs(); this.contextmenu_captureiefromlist.DropDownItems.Clear(); if (tabs.Count > 0) { this.contextmenu_captureie.Enabled = true; diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index 31b8e88cd..f46251e75 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -688,8 +688,7 @@ namespace Greenshot.Helpers { // 2) Is Windows >= Vista & DWM enabled: use DWM // 3) Otherwise use GDI (Screen might be also okay but might lose content) if (isAutoMode) { - // TODO: Decided if this is smart, although we do consider a part of the window... - if (conf.IECapture && IECaptureHelper.IsMostlyIEWindow(windowToCapture, 75)) { + if (conf.IECapture && IECaptureHelper.IsIEWindow(windowToCapture)) { try { ICapture ieCapture = IECaptureHelper.CaptureIE(captureForWindow, windowToCapture); if (ieCapture != null) { diff --git a/Greenshot/Helpers/IECaptureHelper.cs b/Greenshot/Helpers/IECaptureHelper.cs index 058464606..309c8bb91 100644 --- a/Greenshot/Helpers/IECaptureHelper.cs +++ b/Greenshot/Helpers/IECaptureHelper.cs @@ -87,7 +87,10 @@ namespace Greenshot.Helpers { if ("IEFrame".Equals(someWindow.ClassName)) { return true; } - return someWindow.GetChild("Internet Explorer_Server") != null; + if (configuration.WindowClassesToCheckForIE != null && configuration.WindowClassesToCheckForIE.Contains(someWindow.ClassName)) { + return someWindow.GetChild("Internet Explorer_Server") != null; + } + return false; } /// @@ -120,10 +123,10 @@ namespace Greenshot.Helpers { } /// - /// Gets a list of all IE Windows with the captions of the open tabs + /// Gets a list of all IE Windows & tabs with the captions of the instances /// /// List> - public static List> GetTabList() { + public static List> GetBrowserTabs() { List ieHandleList = new List(); Dictionary> browserWindows = new Dictionary>(); @@ -137,7 +140,7 @@ namespace Greenshot.Helpers { Accessible accessible = new Accessible(directUIWD.Handle); browserWindows.Add(ieWindow, accessible.IETabCaptions); } - } else { + } else if (configuration.WindowClassesToCheckForIE != null && configuration.WindowClassesToCheckForIE.Contains(ieWindow.ClassName)) { List singleWindowText = new List(); try { IHTMLDocument2 document2 = getHTMLDocument(ieWindow); diff --git a/GreenshotPlugin/Core/CoreConfiguration.cs b/GreenshotPlugin/Core/CoreConfiguration.cs index fb81448da..4774e7d13 100644 --- a/GreenshotPlugin/Core/CoreConfiguration.cs +++ b/GreenshotPlugin/Core/CoreConfiguration.cs @@ -152,6 +152,8 @@ namespace GreenshotPlugin.Core { public bool IECapture; [IniProperty("IEFieldCapture", Description="Enable/disable IE field capture, very slow but will make it possible to annotate the fields of a capture in the editor.", DefaultValue="False")] public bool IEFieldCapture; + [IniProperty("WindowClassesToCheckForIE", Description = "Comma separated list of Window-Classes which need to be checked for a IE instance!", DefaultValue = "AfxFrameOrView70,IMWindowClass")] + public List WindowClassesToCheckForIE; [IniProperty("AutoCropDifference", Description="Sets how to compare the colors for the autocrop detection, the higher the more is 'selected'. Possible values are from 0 to 255, where everything above ~150 doesn't make much sense!", DefaultValue="10")] public int AutoCropDifference;