FancyZones decomposition (#2485)

* FancyZones refactoring
Co-Authored-By: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
This commit is contained in:
Seraphima Zykova
2020-04-30 13:16:08 +03:00
committed by GitHub
parent 313b1b39a7
commit 7903fe52b4
7 changed files with 448 additions and 345 deletions

View File

@@ -1,6 +1,7 @@
#include "pch.h"
#include "util.h"
#include <common/common.h>
#include <common/dpi_aware.h>
typedef BOOL(WINAPI* GetDpiForMonitorInternalFunc)(HMONITOR, UINT, UINT*, UINT*);
@@ -135,3 +136,19 @@ void SizeWindowToRect(HWND window, RECT rect) noexcept
// This fixes Issue #365
::SetWindowPlacement(window, &placement);
}
bool IsInterestingWindow(HWND window, const std::vector<std::wstring>& excludedApps) noexcept
{
auto filtered = get_fancyzones_filtered_window(window);
if (!filtered.zonable)
{
return false;
}
// Filter out user specified apps
CharUpperBuffW(filtered.process_path.data(), (DWORD)filtered.process_path.length());
if (find_app_name_in_path(filtered.process_path, excludedApps))
{
return false;
}
return true;
}