Small IE capture stability fixes, still most likely no solution to #3557520 and #3557508. In general the code need to be tested with IE9!!!

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1988 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-08-15 10:32:25 +00:00
commit 310c492da1
2 changed files with 25 additions and 12 deletions

View file

@ -250,8 +250,8 @@ namespace Greenshot.Helpers {
}
}
} catch (Exception e) {
LOG.ErrorFormat("Major problem: Problem retrieving Document from {0}", ieWindow.Text);
LOG.Error(e);
LOG.DebugFormat("Major problem: Problem retrieving Document from {0}", ieWindow.Text);
}
}
@ -262,7 +262,12 @@ namespace Greenshot.Helpers {
returnWindow.GetParent();
// Create the container
returnDocumentContainer = new DocumentContainer(returnDocument2, returnWindow);
try {
returnDocumentContainer = new DocumentContainer(returnDocument2, returnWindow);
} catch (Exception e) {
LOG.Error("Major problem: Problem retrieving Document.");
LOG.Error(e);
}
}
if (returnDocumentContainer == null && alternativeReturnDocument2 != null) {
@ -270,7 +275,12 @@ namespace Greenshot.Helpers {
alternativeReturnWindow.Restore();
alternativeReturnWindow.GetParent();
// Create the container
returnDocumentContainer = new DocumentContainer(alternativeReturnDocument2, alternativeReturnWindow);
try {
returnDocumentContainer = new DocumentContainer(alternativeReturnDocument2, alternativeReturnWindow);
} catch (Exception e) {
LOG.Error("Major problem: Problem retrieving Document.");
LOG.Error(e);
}
}
return returnDocumentContainer;
}
@ -291,7 +301,7 @@ namespace Greenshot.Helpers {
/// <returns>ICapture with the content (if any)</returns>
public static ICapture CaptureIE(ICapture capture, WindowDetails windowToCapture) {
if (windowToCapture == null) {
return CaptureIE(capture, WindowDetails.GetActiveWindow());
windowToCapture = WindowDetails.GetActiveWindow();
}
// Show backgroundform after retrieving the active window..
BackgroundForm backgroundForm = new BackgroundForm(Language.GetString(LangKey.contextmenu_captureie), Language.GetString(LangKey.wait_ie_capture));