[FancyZones] Revisit mutexes (#12240)

* [FancyZones] Clean up (#11893)

* [FancyZones] Virtual desktop utils refactoring (#11925)

* [FancyZones] IFancyZonesCallback refactoring (#11932)

* [FancyZones] IZoneWindowHost refactoring (#12091)

* [FancyZones] Rename ZoneWindow -> WorkArea (#12223)

* [FancyZones] Clean up mutexes (#12228)
This commit is contained in:
Seraphima Zykova
2021-07-07 13:18:52 +03:00
committed by GitHub
parent 3f70c8c889
commit d85c3f8cc9
40 changed files with 946 additions and 1389 deletions

View File

@@ -18,6 +18,7 @@ namespace NonLocalizable
{
const wchar_t PowerToysAppPowerLauncher[] = L"POWERLAUNCHER.EXE";
const wchar_t PowerToysAppFZEditor[] = L"FANCYZONESEDITOR.EXE";
const wchar_t SplashClassName[] = L"MsoSplash";
}
bool find_app_name_in_path(const std::wstring& where, const std::vector<std::wstring>& what)
@@ -604,6 +605,17 @@ namespace FancyZonesUtils
return SUCCEEDED(CLSIDFromString(str.c_str(), &id));
}
std::optional<std::wstring> GuidToString(const GUID& guid) noexcept
{
wil::unique_cotaskmem_string guidString;
if (SUCCEEDED(StringFromCLSID(guid, &guidString)))
{
return guidString.get();
}
return std::nullopt;
}
bool IsValidDeviceId(const std::wstring& str)
{
std::wstring monitorName;
@@ -862,4 +874,15 @@ namespace FancyZonesUtils
return false;
}
bool IsSplashScreen(HWND window)
{
wchar_t className[MAX_PATH];
if (GetClassName(window, className, MAX_PATH) == 0)
{
return false;
}
return wcscmp(NonLocalizable::SplashClassName, className) == 0;
}
}