mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-28 15:49:15 +08:00
[PTRun][WindowWalker]Fix analyzer errors (#16887)
This commit is contained in:
parent
0a5bdf6734
commit
eb961ee052
@ -53,7 +53,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
|
||||
// Hide menu if Explorer.exe is the shell process or the process name is ApplicationFrameHost.exe
|
||||
// In the first case we would crash the windows ui and in the second case we would kill the generic process for uwp apps.
|
||||
if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower() == "applicationframehost.exe")
|
||||
if (!windowData.Process.IsShellProcess && !(windowData.Process.IsUwpApp & windowData.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "applicationframehost.exe")
|
||||
&& !(windowData.Process.IsFullAccessDenied & WindowWalkerSettings.Instance.HideKillProcessOnElevatedProcesses))
|
||||
{
|
||||
contextMenu.Add(new ContextMenuResult
|
||||
@ -78,7 +78,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
private static bool KillProcessCommand(Window window)
|
||||
{
|
||||
// Validate process
|
||||
if (!window.IsWindow || !window.Process.DoesExist || !window.Process.Name.Equals(WindowProcess.GetProcessNameFromProcessID(window.Process.ProcessID)) )
|
||||
if (!window.IsWindow || !window.Process.DoesExist || !window.Process.Name.Equals(WindowProcess.GetProcessNameFromProcessID(window.Process.ProcessID), StringComparison.Ordinal) )
|
||||
{
|
||||
Log.Debug($"Can not kill process '{window.Process.Name}' ({window.Process.ProcessID}) of the window '{window.Title}' ({window.Hwnd}), because it doesn't exist.", typeof(ContextMenuHelper));
|
||||
return false;
|
||||
|
@ -26,7 +26,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
|
||||
foreach (SearchResult x in searchControllerResults)
|
||||
{
|
||||
if (x.Result.Process.Name.ToLower() == "explorer.exe" && x.Result.Process.IsShellProcess)
|
||||
if (x.Result.Process.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture) == "explorer.exe" && x.Result.Process.IsShellProcess)
|
||||
{
|
||||
addExplorerInfo = true;
|
||||
}
|
||||
|
@ -241,9 +241,9 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper
|
||||
}
|
||||
|
||||
// If the desktop name was not changed by the user, it isn't saved to the registry. Then we need the default name for the desktop.
|
||||
var defaultName = string.Format(Resources.VirtualDesktopHelper_Desktop, GetDesktopNumber(desktop));
|
||||
var defaultName = string.Format(System.Globalization.CultureInfo.InvariantCulture, Resources.VirtualDesktopHelper_Desktop, GetDesktopNumber(desktop));
|
||||
|
||||
string registryPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VirtualDesktops\\Desktops\\{" + desktop.ToString().ToUpper() + "}";
|
||||
string registryPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VirtualDesktops\\Desktops\\{" + desktop.ToString().ToUpper(System.Globalization.CultureInfo.InvariantCulture) + "}";
|
||||
RegistryKey deskSubKey = Registry.CurrentUser.OpenSubKey(registryPath, false);
|
||||
var desktopName = deskSubKey?.GetValue("Name");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user