Tweaking the IE capturing to only consider IE windows and special configured windows. This should speed up the process of getting the available IE's and cause less confusion.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2049 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-18 07:16:39 +00:00
commit 45e018d197
4 changed files with 11 additions and 7 deletions

View file

@ -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;
}
/// <summary>
@ -120,10 +123,10 @@ namespace Greenshot.Helpers {
}
/// <summary>
/// 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
/// </summary>
/// <returns>List<KeyValuePair<WindowDetails, string>></returns>
public static List<KeyValuePair<WindowDetails, string>> GetTabList() {
public static List<KeyValuePair<WindowDetails, string>> GetBrowserTabs() {
List<IntPtr> ieHandleList = new List<IntPtr>();
Dictionary<WindowDetails, List<string>> browserWindows = new Dictionary<WindowDetails, List<string>>();
@ -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<string> singleWindowText = new List<string>();
try {
IHTMLDocument2 document2 = getHTMLDocument(ieWindow);