mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve process information handler
This commit is contained in:
parent
50a8e888f0
commit
d56f0a0d1a
2 changed files with 31 additions and 6 deletions
|
|
@ -71,18 +71,43 @@ internal static class Program
|
|||
|
||||
try
|
||||
{
|
||||
using var process = new Process
|
||||
ProcessStartInfo info;
|
||||
if (argumentList.Count == 0)
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
info = new ProcessStartInfo
|
||||
{
|
||||
FileName = fileName,
|
||||
WorkingDirectory = workingDirectory,
|
||||
Arguments = string.Join(" ", argumentList),
|
||||
UseShellExecute = useShellExecute,
|
||||
Verb = verb
|
||||
};
|
||||
}
|
||||
else if (argumentList.Count == 1)
|
||||
{
|
||||
info = new ProcessStartInfo
|
||||
{
|
||||
FileName = fileName,
|
||||
WorkingDirectory = workingDirectory,
|
||||
Arguments = argumentList[0],
|
||||
UseShellExecute = useShellExecute,
|
||||
Verb = verb
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
info = new ProcessStartInfo
|
||||
{
|
||||
FileName = fileName,
|
||||
WorkingDirectory = workingDirectory,
|
||||
UseShellExecute = useShellExecute,
|
||||
Verb = verb
|
||||
};
|
||||
foreach (var arg in argumentList)
|
||||
{
|
||||
info.ArgumentList.Add(arg);
|
||||
}
|
||||
};
|
||||
process.Start();
|
||||
}
|
||||
Process.Start(info)?.Dispose();
|
||||
Console.WriteLine("Success.");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
return true;
|
||||
}
|
||||
|
||||
private void OnWinRPressed()
|
||||
private static void OnWinRPressed()
|
||||
{
|
||||
Context.API.ShowMainWindow();
|
||||
// show the main window and set focus to the query box
|
||||
|
|
|
|||
Loading…
Reference in a new issue