mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Added the FEATURE-998 also to the open last file context menu.
This commit is contained in:
parent
4029e01491
commit
96b92df495
3 changed files with 58 additions and 38 deletions
|
@ -512,22 +512,14 @@ namespace Greenshot.Helpers {
|
|||
string errorMessage = null;
|
||||
var path = Path.GetDirectoryName(surface.LastSaveFullPath);
|
||||
try {
|
||||
if (path != null)
|
||||
{
|
||||
var processStartInfo = new ProcessStartInfo("explorer.exe")
|
||||
{
|
||||
Arguments = path,
|
||||
UseShellExecute = false
|
||||
};
|
||||
using (var process = new Process()) {
|
||||
process.StartInfo = processStartInfo;
|
||||
process.Start();
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ExplorerHelper.OpenInExplorer(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = ex.Message;
|
||||
}
|
||||
// Added fallback for when the explorer can't be found
|
||||
// TODO: Check if this makes sense
|
||||
if (errorMessage != null) {
|
||||
try {
|
||||
string windowsPath = Environment.GetEnvironmentVariable("SYSTEMROOT");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue