[New Utility]Mouse Without Borders

* Integrate Mouse Without Borders into PowerToys

---------

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
Andrey Nekrasov
2023-05-15 23:32:26 +01:00
committed by Jaime Bernardo
parent a0b9af039d
commit 29eebe16a4
304 changed files with 37234 additions and 133 deletions

View File

@@ -49,6 +49,7 @@ namespace powertoys_gpo {
const std::wstring POLICY_CONFIGURE_ENABLED_PASTE_PLAIN = L"ConfigureEnabledUtilityPastePlain";
const std::wstring POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE = L"ConfigureEnabledUtilityVideoConferenceMute";
const std::wstring POLICY_CONFIGURE_ENABLED_REGISTRY_PREVIEW = L"ConfigureEnabledUtilityRegistryPreview";
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS = L"ConfigureEnabledUtilityMouseWithoutBorders";
const std::wstring POLICY_CONFIGURE_ENABLED_PEEK = L"ConfigureEnabledUtilityPeek";
// The registry value names for PowerToys installer and update policies.
@@ -258,6 +259,11 @@ namespace powertoys_gpo {
return getConfiguredValue(POLICY_CONFIGURE_ENABLED_VIDEO_CONFERENCE_MUTE);
}
inline gpo_rule_configured_t getConfiguredMouseWithoutBordersEnabledValue()
{
return getConfiguredValue(POLICY_CONFIGURE_ENABLED_MOUSE_WITHOUT_BORDERS);
}
inline gpo_rule_configured_t getConfiguredPeekEnabledValue()
{
return getConfiguredValue(POLICY_CONFIGURE_ENABLED_PEEK);

View File

@@ -22,14 +22,15 @@ inline std::vector<wil::unique_process_handle> getProcessHandlesByName(const std
}
processIds.resize(bytesRequired / sizeof(processIds[0]));
handleAccess |= PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ;
handleAccess |= PROCESS_QUERY_LIMITED_INFORMATION;
for (const DWORD processId : processIds)
{
try
{
wil::unique_process_handle hProcess{ OpenProcess(handleAccess, FALSE, processId) };
wchar_t name[MAX_PATH + 1];
if (!hProcess || !GetProcessImageFileNameW(hProcess.get(), name, MAX_PATH))
DWORD length = MAX_PATH;
if (!hProcess || !QueryFullProcessImageNameW(hProcess.get(), 0, name, &length))
{
continue;
}