mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user