mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[QuickAccent] A check is added to applications running under other ap… (#26808)
* [QuickAccent] A check is added to applications running under other applications with window name for excluding. * [QuickAccent] Check moved under a general function and applied all modules includes excludeapp * [QuickAccent] Function name revised * [QuickAccent] check_excluded_app_with_title function moved to excluded_apps.h * [QuickAccent] New function created for clean code. * Reuse check_excluded_app_with_title --------- Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
This commit is contained in:
@@ -26,6 +26,7 @@ namespace NonLocalizable
|
||||
enum DWMWINDOWATTRIBUTE_CUSTOM
|
||||
{
|
||||
DWMWA_WINDOW_CORNER_PREFERENCE = 33
|
||||
|
||||
};
|
||||
|
||||
enum DWM_WINDOW_CORNER_PREFERENCE
|
||||
@@ -227,12 +228,12 @@ bool FancyZonesWindowUtils::IsCandidateForZoning(HWND window)
|
||||
|
||||
std::wstring processPath = get_process_path_waiting_uwp(window);
|
||||
CharUpperBuffW(const_cast<std::wstring&>(processPath).data(), static_cast<DWORD>(processPath.length()));
|
||||
if (IsExcludedByUser(processPath))
|
||||
if (IsExcludedByUser(window, processPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsExcludedByDefault(processPath))
|
||||
if (IsExcludedByDefault(window, processPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -267,12 +268,12 @@ bool FancyZonesWindowUtils::IsProcessOfWindowElevated(HWND window)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FancyZonesWindowUtils::IsExcludedByUser(const std::wstring& processPath) noexcept
|
||||
bool FancyZonesWindowUtils::IsExcludedByUser(const HWND& hwnd, std::wstring& processPath) noexcept
|
||||
{
|
||||
return (find_app_name_in_path(processPath, FancyZonesSettings::settings().excludedAppsArray));
|
||||
return (check_excluded_app(hwnd, processPath, FancyZonesSettings::settings().excludedAppsArray));
|
||||
}
|
||||
|
||||
bool FancyZonesWindowUtils::IsExcludedByDefault(const std::wstring& processPath) noexcept
|
||||
bool FancyZonesWindowUtils::IsExcludedByDefault(const HWND& hwnd, std::wstring& processPath) noexcept
|
||||
{
|
||||
static std::vector<std::wstring> defaultExcludedFolders = { NonLocalizable::SystemAppsFolder };
|
||||
if (find_folder_in_path(processPath, defaultExcludedFolders))
|
||||
@@ -281,7 +282,7 @@ bool FancyZonesWindowUtils::IsExcludedByDefault(const std::wstring& processPath)
|
||||
}
|
||||
|
||||
static std::vector<std::wstring> defaultExcludedApps = { NonLocalizable::PowerToysAppFZEditor, NonLocalizable::CoreWindow, NonLocalizable::SearchUI };
|
||||
return (find_app_name_in_path(processPath, defaultExcludedApps));
|
||||
return (check_excluded_app(hwnd, processPath, defaultExcludedApps));
|
||||
}
|
||||
|
||||
void FancyZonesWindowUtils::SwitchToWindow(HWND window) noexcept
|
||||
|
||||
Reference in New Issue
Block a user