From c00ed8f996e5b6c7d476efa11cf8610bdc0eb739 Mon Sep 17 00:00:00 2001 From: seraphima Date: Tue, 2 Jul 2024 15:47:24 +0200 Subject: [PATCH] changed window filter https://github.com/JaneaSystems/PowerToys-DevProjects/issues/2 --- .../Projects/ProjectsSnapshotTool/main.cpp | 2 +- .../Projects/projects-common/WindowUtils.h | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/modules/Projects/ProjectsSnapshotTool/main.cpp b/src/modules/Projects/ProjectsSnapshotTool/main.cpp index 496501b396..017108f655 100644 --- a/src/modules/Projects/ProjectsSnapshotTool/main.cpp +++ b/src/modules/Projects/ProjectsSnapshotTool/main.cpp @@ -89,7 +89,7 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR cmdLine, int cm } auto data = Utils::Apps::GetApp(processPath, apps); - if (!data.has_value()) + if (!data.has_value() || data->name.empty()) { continue; } diff --git a/src/modules/Projects/projects-common/WindowUtils.h b/src/modules/Projects/projects-common/WindowUtils.h index 37a9c5bae5..e414cfd307 100644 --- a/src/modules/Projects/projects-common/WindowUtils.h +++ b/src/modules/Projects/projects-common/WindowUtils.h @@ -15,14 +15,15 @@ namespace WindowUtils // Non-Localizable strings namespace NonLocalizable { - const wchar_t SystemAppsFolder[] = L"SYSTEMAPPS"; - const wchar_t System[] = L"WINDOWS/SYSTEM"; - const wchar_t System32[] = L"SYSTEM32"; - const wchar_t SystemWOW64[] = L"SYSTEMWOW64"; const char SplashClassName[] = "MsoSplash"; + + const wchar_t SystemAppsFolder[] = L"SYSTEMAPPS"; + const wchar_t CoreWindow[] = L"WINDOWS.UI.CORE.COREWINDOW"; const wchar_t SearchUI[] = L"SEARCHUI.EXE"; - const wchar_t HelpWindow[] = L"C:\\WINDOWS\\HH.EXE"; + const wchar_t HelpWindow[] = L"WINDOWS\\HH.EXE"; + const wchar_t ApplicationFrameHost[] = L"WINDOWS\\SYSTEM32\\APPLICATIONFRAMEHOST.EXE"; + const wchar_t ProjectsSnapshotTool[] = L"POWERTOYS.PROJECTSSNAPSHOTTOOL"; const wchar_t ProjectsEditor[] = L"POWERTOYS.PROJECTSEDITOR"; const wchar_t ProjectsLauncher[] = L"POWERTOYS.PROJECTSLAUNCHER"; @@ -55,10 +56,7 @@ namespace WindowUtils CharUpperBuffW(processPathUpper.data(), static_cast(processPathUpper.length())); static std::vector defaultExcludedFolders = { - NonLocalizable::SystemAppsFolder, - NonLocalizable::System, - NonLocalizable::System32, - NonLocalizable::SystemWOW64 + NonLocalizable::SystemAppsFolder, }; if (find_folder_in_path(processPathUpper, defaultExcludedFolders)) {