mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
Fixed bug #3582282 with displaying a dialog so the user can retry the operation after closing the dialog of the target application.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2233 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
7710db665c
commit
cd01b2197b
4 changed files with 53 additions and 34 deletions
|
@ -35,6 +35,8 @@ schnell zu finden. Vielen Dank :)</resource>
|
||||||
<resource name="colorpicker_red">Rot</resource>
|
<resource name="colorpicker_red">Rot</resource>
|
||||||
<resource name="colorpicker_title">Farbauswahl</resource>
|
<resource name="colorpicker_title">Farbauswahl</resource>
|
||||||
<resource name="colorpicker_transparent">Transparent</resource>
|
<resource name="colorpicker_transparent">Transparent</resource>
|
||||||
|
<resource name="com_rejected">Das Ziel hat Greenshot abgewiesen, vermutlich ist ein Dialogfeld geöffnet. Schließen Sie das Dialogfeld und versuchen Sie es erneut.</resource>
|
||||||
|
<resource name="com_rejected_title">Greenshot Zugriff abgewiesen</resource>
|
||||||
<resource name="config_unauthorizedaccess_write">Die Greenshot Einstellungen konnten nicht gespeichert werden. Bitte prüfen Sie die Berechtigungen auf '{0}'.</resource>
|
<resource name="config_unauthorizedaccess_write">Die Greenshot Einstellungen konnten nicht gespeichert werden. Bitte prüfen Sie die Berechtigungen auf '{0}'.</resource>
|
||||||
<resource name="contextmenu_about">Über Greenshot</resource>
|
<resource name="contextmenu_about">Über Greenshot</resource>
|
||||||
<resource name="contextmenu_capturearea">Bereich abfotografieren</resource>
|
<resource name="contextmenu_capturearea">Bereich abfotografieren</resource>
|
||||||
|
|
|
@ -5,18 +5,18 @@
|
||||||
<resource name="about_donations">If you like Greenshot, you are welcome to support us:</resource>
|
<resource name="about_donations">If you like Greenshot, you are welcome to support us:</resource>
|
||||||
<resource name="about_host">Greenshot is hosted by sourceforge.net at</resource>
|
<resource name="about_host">Greenshot is hosted by sourceforge.net at</resource>
|
||||||
<resource name="about_icons">Icons from Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license)</resource>
|
<resource name="about_icons">Icons from Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license)</resource>
|
||||||
<resource name="about_license">Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
|
<resource name="about_license">Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.
|
Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.
|
||||||
Details about the GNU General Public License:</resource>
|
Details about the GNU General Public License:</resource>
|
||||||
<resource name="about_title">About Greenshot</resource>
|
<resource name="about_title">About Greenshot</resource>
|
||||||
<resource name="application_title">Greenshot - the revolutionary screenshot utility</resource>
|
<resource name="application_title">Greenshot - the revolutionary screenshot utility</resource>
|
||||||
<resource name="bugreport_cancel">Close</resource>
|
<resource name="bugreport_cancel">Close</resource>
|
||||||
<resource name="bugreport_info">Sorry, an unexpected error occured.
|
<resource name="bugreport_info">Sorry, an unexpected error occured.
|
||||||
|
|
||||||
The good news is: you can help us getting rid of it by filing a bug report.
|
The good news is: you can help us getting rid of it by filing a bug report.
|
||||||
Please visit the URL below, create a new bug report and paste the contents from the text area into the description.
|
Please visit the URL below, create a new bug report and paste the contents from the text area into the description.
|
||||||
|
|
||||||
Please add a meaningful summary and enclose any information you consider to be helpful for reproducing the issue.
|
Please add a meaningful summary and enclose any information you consider to be helpful for reproducing the issue.
|
||||||
Also, we would highly appreciate if you checked whether a tracker item already exists for this bug. (You can use the search to find those quickly.) Thank you :)</resource>
|
Also, we would highly appreciate if you checked whether a tracker item already exists for this bug. (You can use the search to find those quickly.) Thank you :)</resource>
|
||||||
<resource name="bugreport_title">Error</resource>
|
<resource name="bugreport_title">Error</resource>
|
||||||
<resource name="CANCEL">Cancel</resource>
|
<resource name="CANCEL">Cancel</resource>
|
||||||
|
@ -35,6 +35,8 @@ Also, we would highly appreciate if you checked whether a tracker item already e
|
||||||
<resource name="colorpicker_red">Red</resource>
|
<resource name="colorpicker_red">Red</resource>
|
||||||
<resource name="colorpicker_title">Color picker</resource>
|
<resource name="colorpicker_title">Color picker</resource>
|
||||||
<resource name="colorpicker_transparent">Transparent</resource>
|
<resource name="colorpicker_transparent">Transparent</resource>
|
||||||
|
<resource name="com_rejected">The destination rejected Greenshot access, a dialog is probably open. Close the dialog and try again.</resource>
|
||||||
|
<resource name="com_rejected_title">Greenshot access rejected</resource>
|
||||||
<resource name="config_unauthorizedaccess_write">Could not save Greenshot's configuration file. Please check access permissions for '{0}'.</resource>
|
<resource name="config_unauthorizedaccess_write">Could not save Greenshot's configuration file. Please check access permissions for '{0}'.</resource>
|
||||||
<resource name="contextmenu_about">About Greenshot</resource>
|
<resource name="contextmenu_about">About Greenshot</resource>
|
||||||
<resource name="contextmenu_capturearea">Capture region</resource>
|
<resource name="contextmenu_capturearea">Capture region</resource>
|
||||||
|
@ -145,7 +147,7 @@ Also, we would highly appreciate if you checked whether a tracker item already e
|
||||||
<resource name="EmailFormat.OUTLOOK_TXT">Outlook with text</resource>
|
<resource name="EmailFormat.OUTLOOK_TXT">Outlook with text</resource>
|
||||||
<resource name="error">Error</resource>
|
<resource name="error">Error</resource>
|
||||||
<resource name="error_multipleinstances">An instance of Greenshot is already running.</resource>
|
<resource name="error_multipleinstances">An instance of Greenshot is already running.</resource>
|
||||||
<resource name="error_nowriteaccess">Cannot save file to {0}.
|
<resource name="error_nowriteaccess">Cannot save file to {0}.
|
||||||
Please check write accessibility of the selected storage location.</resource>
|
Please check write accessibility of the selected storage location.</resource>
|
||||||
<resource name="error_openfile">The file "{0}" could not be opened.</resource>
|
<resource name="error_openfile">The file "{0}" could not be opened.</resource>
|
||||||
<resource name="error_openlink">Could not open link '{0}'.</resource>
|
<resource name="error_openlink">Could not open link '{0}'.</resource>
|
||||||
|
@ -205,22 +207,22 @@ Please check write accessibility of the selected storage location.</resource>
|
||||||
<resource name="settings_iecapture">Internet Explorer capture</resource>
|
<resource name="settings_iecapture">Internet Explorer capture</resource>
|
||||||
<resource name="settings_jpegquality">JPEG quality</resource>
|
<resource name="settings_jpegquality">JPEG quality</resource>
|
||||||
<resource name="settings_language">Language</resource>
|
<resource name="settings_language">Language</resource>
|
||||||
<resource name="settings_message_filenamepattern">The following placeholders will be replaced automatically in the pattern defined:
|
<resource name="settings_message_filenamepattern">The following placeholders will be replaced automatically in the pattern defined:
|
||||||
${YYYY} year, 4 digits
|
${YYYY} year, 4 digits
|
||||||
${MM} month, 2 digits
|
${MM} month, 2 digits
|
||||||
${DD} day, 2 digits
|
${DD} day, 2 digits
|
||||||
${hh} hour, 2 digits
|
${hh} hour, 2 digits
|
||||||
${mm} minute, 2 digits
|
${mm} minute, 2 digits
|
||||||
${ss} second, 2 digits
|
${ss} second, 2 digits
|
||||||
${NUM} incrementing number, 6 digits
|
${NUM} incrementing number, 6 digits
|
||||||
${title} Window title
|
${title} Window title
|
||||||
${user} Windows user
|
${user} Windows user
|
||||||
${domain} Windows domain
|
${domain} Windows domain
|
||||||
${hostname} PC name
|
${hostname} PC name
|
||||||
|
|
||||||
You can also have Greenshot create directories dynamically, simply use the backslash symbol (\) to separate folders and filename.
|
You can also have Greenshot create directories dynamically, simply use the backslash symbol (\) to separate folders and filename.
|
||||||
Example: the pattern ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss}
|
Example: the pattern ${YYYY}-${MM}-${DD}\${hh}-${mm}-${ss}
|
||||||
will generate a folder for the current day in your default storage location, e.g. 2008-06-29, the contained screenshot file's name will be based on the current
|
will generate a folder for the current day in your default storage location, e.g. 2008-06-29, the contained screenshot file's name will be based on the current
|
||||||
time, e.g. 11_58_32 (plus extension defined in the settings)</resource>
|
time, e.g. 11_58_32 (plus extension defined in the settings)</resource>
|
||||||
<resource name="settings_network">Network and updates</resource>
|
<resource name="settings_network">Network and updates</resource>
|
||||||
<resource name="settings_output">Output</resource>
|
<resource name="settings_output">Output</resource>
|
||||||
|
@ -255,8 +257,8 @@ time, e.g. 11_58_32 (plus extension defined in the settings)</resource>
|
||||||
<resource name="update_found">A newer version of Greenshot is available! Do you want to download Greenshot {0}?</resource>
|
<resource name="update_found">A newer version of Greenshot is available! Do you want to download Greenshot {0}?</resource>
|
||||||
<resource name="wait_ie_capture">Please wait while the page in Internet Explorer is captured...</resource>
|
<resource name="wait_ie_capture">Please wait while the page in Internet Explorer is captured...</resource>
|
||||||
<resource name="warning">Warning</resource>
|
<resource name="warning">Warning</resource>
|
||||||
<resource name="warning_hotkeys">The hotkey(s) "{0}" could not be registered. This problem is probably caused by another tool claiming usage of the same hotkey(s)! You could either change your hotkey settings or deactivate/change the software making use of the hotkey(s).
|
<resource name="warning_hotkeys">The hotkey(s) "{0}" could not be registered. This problem is probably caused by another tool claiming usage of the same hotkey(s)! You could either change your hotkey settings or deactivate/change the software making use of the hotkey(s).
|
||||||
|
|
||||||
All Greenshot features still work directly from the tray icon context menu without hotkeys.</resource>
|
All Greenshot features still work directly from the tray icon context menu without hotkeys.</resource>
|
||||||
<resource name="WindowCaptureMode.Aero">Use custom color</resource>
|
<resource name="WindowCaptureMode.Aero">Use custom color</resource>
|
||||||
<resource name="WindowCaptureMode.AeroTransparent">Preserve transparency</resource>
|
<resource name="WindowCaptureMode.AeroTransparent">Preserve transparency</resource>
|
||||||
|
|
|
@ -24,6 +24,8 @@ using System.Runtime.InteropServices;
|
||||||
using System.Runtime.Remoting;
|
using System.Runtime.Remoting;
|
||||||
using System.Runtime.Remoting.Messaging;
|
using System.Runtime.Remoting.Messaging;
|
||||||
using System.Runtime.Remoting.Proxies;
|
using System.Runtime.Remoting.Proxies;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using GreenshotPlugin.Core;
|
||||||
|
|
||||||
namespace Greenshot.Interop {
|
namespace Greenshot.Interop {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -33,6 +35,7 @@ namespace Greenshot.Interop {
|
||||||
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(COMWrapper));
|
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(COMWrapper));
|
||||||
private const int MK_E_UNAVAILABLE = -2147221021;
|
private const int MK_E_UNAVAILABLE = -2147221021;
|
||||||
private const int CO_E_CLASSSTRING = -2147221005;
|
private const int CO_E_CLASSSTRING = -2147221005;
|
||||||
|
private const int RPC_E_CALL_REJECTED = unchecked((int)0x80010001);
|
||||||
|
|
||||||
#region Private Data
|
#region Private Data
|
||||||
|
|
||||||
|
@ -556,11 +559,23 @@ namespace Greenshot.Interop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
do {
|
||||||
returnValue = invokeType.InvokeMember(methodName, flags, null, invokeObject, args, argModifiers, null, null);
|
try {
|
||||||
} catch (Exception ex) {
|
returnValue = invokeType.InvokeMember(methodName, flags, null, invokeObject, args, argModifiers, null, null);
|
||||||
return new ReturnMessage(ex, callMessage);
|
break;
|
||||||
}
|
} catch (Exception ex) {
|
||||||
|
// Test for rejected
|
||||||
|
COMException comEx = ex as COMException;
|
||||||
|
if (comEx != null && comEx.ErrorCode == RPC_E_CALL_REJECTED) {
|
||||||
|
DialogResult result = MessageBox.Show(Language.GetString("com_rejected"), Language.GetString("com_rejected_title"), MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation);
|
||||||
|
if (result == DialogResult.OK) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Not rejected OR pressed cancel
|
||||||
|
return new ReturnMessage(ex, callMessage);
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
|
|
||||||
// Handle enum and interface return types
|
// Handle enum and interface return types
|
||||||
if (null != returnValue) {
|
if (null != returnValue) {
|
||||||
|
|
|
@ -364,9 +364,9 @@ namespace Greenshot.Interop.Office {
|
||||||
newMail.Display(false);
|
newMail.Display(false);
|
||||||
newMail.GetInspector().Activate();
|
newMail.GetInspector().Activate();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.WarnFormat("Problem displaying the new email, retrying to display it. Problem: {0}", ex.Message);
|
LOG.Warn("Problem displaying the new email, retrying to display it. Problem:", ex);
|
||||||
Thread retryDisplayEmail = new Thread(delegate() {
|
Thread retryDisplayEmail = new Thread(delegate() {
|
||||||
int retries = 60;
|
int retries = 10;
|
||||||
int retryInXSeconds = 5;
|
int retryInXSeconds = 5;
|
||||||
while (retries-- > 0) {
|
while (retries-- > 0) {
|
||||||
Thread.Sleep(retryInXSeconds * 1000);
|
Thread.Sleep(retryInXSeconds * 1000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue