Fixed issue when the selected IE window to capture is not visible/iconized, a restore fixes this.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2192 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-10-23 09:10:20 +00:00
commit afbe046d3e

View file

@ -873,13 +873,17 @@ namespace Greenshot {
ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;
KeyValuePair<WindowDetails, int> tabData = (KeyValuePair<WindowDetails, int>)clickedItem.Tag; KeyValuePair<WindowDetails, int> tabData = (KeyValuePair<WindowDetails, int>)clickedItem.Tag;
BeginInvoke((MethodInvoker)delegate { BeginInvoke((MethodInvoker)delegate {
WindowDetails ieWindowToCapture = tabData.Key;
if (ieWindowToCapture != null && (!ieWindowToCapture.Visible || ieWindowToCapture.Iconic)) {
ieWindowToCapture.Restore();
}
try { try {
IECaptureHelper.ActivateIETab(tabData.Key, tabData.Value); IECaptureHelper.ActivateIETab(ieWindowToCapture, tabData.Value);
} catch (Exception exception) { } catch (Exception exception) {
LOG.Error(exception); LOG.Error(exception);
} }
try { try {
CaptureHelper.CaptureIE(false, tabData.Key); CaptureHelper.CaptureIE(false, ieWindowToCapture);
} catch (Exception exception) { } catch (Exception exception) {
LOG.Error(exception); LOG.Error(exception);
} }