mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Extended the running instance MessageBox with the paths of the instances. Made to get a better fix for #3526579
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1847 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
6811094a29
commit
e5cf074386
5 changed files with 72 additions and 52 deletions
|
@ -215,7 +215,23 @@ namespace Greenshot {
|
|||
if (filesToOpen.Count > 0) {
|
||||
SendData(transport);
|
||||
} else {
|
||||
MessageBox.Show(Language.GetString(LangKey.error_multipleinstances), Language.GetString(LangKey.error));
|
||||
StringBuilder instanceInfo = new StringBuilder();
|
||||
bool matchedThisProcess = false;
|
||||
int index = 1;
|
||||
foreach (Process greenshotProcess in Process.GetProcessesByName("greenshot")) {
|
||||
try {
|
||||
instanceInfo.Append(index++ + ": ").AppendLine(Kernel32.GetProcessPath(new IntPtr(greenshotProcess.Id)));
|
||||
if (Process.GetCurrentProcess().Id == greenshotProcess.Id) {
|
||||
matchedThisProcess = true;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LOG.Debug(ex);
|
||||
}
|
||||
}
|
||||
if (!matchedThisProcess) {
|
||||
instanceInfo.Append(index++ + ": ").AppendLine(Kernel32.GetProcessPath(new IntPtr(Process.GetCurrentProcess().Id)));
|
||||
}
|
||||
MessageBox.Show(Language.GetString(LangKey.error_multipleinstances) + "\r\n" + instanceInfo.ToString(), Language.GetString(LangKey.error));
|
||||
}
|
||||
FreeMutex();
|
||||
Application.Exit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue