[PTRun][Window]PowerLauncher removed from results (#14786)

This commit is contained in:
Davide Giacometti 2021-12-06 20:27:10 +01:00 committed by GitHub
parent 88ec74d81e
commit d7e36079fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@
// Code forked from Betsegaw Tadele's https://github.com/betsegaw/windowwalker/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
namespace Microsoft.Plugin.WindowWalker.Components
{
@ -13,6 +15,11 @@ namespace Microsoft.Plugin.WindowWalker.Components
/// </summary>
internal class OpenWindows
{
/// <summary>
/// PowerLauncher main executable
/// </summary>
private static readonly string _powerLauncherExe = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName);
/// <summary>
/// Delegate handler for open windows updates
/// </summary>
@ -86,7 +93,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
if (newWindow.IsWindow && newWindow.Visible && newWindow.IsOwner &&
(!newWindow.IsToolWindow || newWindow.IsAppWindow) && !newWindow.TaskListDeleted &&
newWindow.ClassName != "Windows.UI.Core.CoreWindow")
newWindow.ClassName != "Windows.UI.Core.CoreWindow" && newWindow.ProcessName != _powerLauncherExe)
{
windows.Add(newWindow);
}