mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[FindMyMouse] Add setting for excluded apps (#16308)
* refactor find_app_name_in_path * Add a setting for excluded apps * Restore game_mode.h
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <common/display/dpi_aware.h>
|
||||
#include <common/utils/game_mode.h>
|
||||
#include <common/utils/excluded_apps.h>
|
||||
#include <common/utils/resources.h>
|
||||
#include <common/utils/winapi_error.h>
|
||||
#include <common/utils/process_path.h>
|
||||
@@ -15,22 +16,6 @@ namespace NonLocalizable
|
||||
const static wchar_t* WINDOW_IS_PINNED_PROP = L"AlwaysOnTop_Pinned";
|
||||
}
|
||||
|
||||
// TODO: move to common utils
|
||||
bool find_app_name_in_path(const std::wstring& where, const std::vector<std::wstring>& what)
|
||||
{
|
||||
for (const auto& row : what)
|
||||
{
|
||||
const auto pos = where.rfind(row);
|
||||
const auto last_slash = where.rfind('\\');
|
||||
//Check that row occurs in where, and its last occurrence contains in itself the first character after the last backslash.
|
||||
if (pos != std::wstring::npos && pos <= last_slash + 1 && pos + row.length() > last_slash)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isExcluded(HWND window)
|
||||
{
|
||||
auto processPath = get_process_path(window);
|
||||
|
||||
Reference in New Issue
Block a user