mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
fix build error
This commit is contained in:
@@ -16,6 +16,47 @@
|
|||||||
|
|
||||||
namespace registry
|
namespace registry
|
||||||
{
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
struct on_exit
|
||||||
|
{
|
||||||
|
std::function<void()> f;
|
||||||
|
|
||||||
|
on_exit(std::function<void()> f) :
|
||||||
|
f{ std::move(f) } {}
|
||||||
|
~on_exit() { f(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class... Ts>
|
||||||
|
struct overloaded : Ts...
|
||||||
|
{
|
||||||
|
using Ts::operator()...;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class... Ts>
|
||||||
|
overloaded(Ts...) -> overloaded<Ts...>;
|
||||||
|
|
||||||
|
inline const wchar_t* getScopeName(HKEY scope)
|
||||||
|
{
|
||||||
|
if (scope == HKEY_LOCAL_MACHINE)
|
||||||
|
{
|
||||||
|
return L"HKLM";
|
||||||
|
}
|
||||||
|
else if (scope == HKEY_CURRENT_USER)
|
||||||
|
{
|
||||||
|
return L"HKCU";
|
||||||
|
}
|
||||||
|
else if (scope == HKEY_CLASSES_ROOT)
|
||||||
|
{
|
||||||
|
return L"HKCR";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return L"HK??";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
namespace install_scope
|
namespace install_scope
|
||||||
{
|
{
|
||||||
const wchar_t INSTALL_SCOPE_REG_KEY[] = L"Software\\Classes\\powertoys\\";
|
const wchar_t INSTALL_SCOPE_REG_KEY[] = L"Software\\Classes\\powertoys\\";
|
||||||
@@ -160,47 +201,6 @@ namespace registry
|
|||||||
template<class>
|
template<class>
|
||||||
inline constexpr bool always_false_v = false;
|
inline constexpr bool always_false_v = false;
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
struct on_exit
|
|
||||||
{
|
|
||||||
std::function<void()> f;
|
|
||||||
|
|
||||||
on_exit(std::function<void()> f) :
|
|
||||||
f{ std::move(f) } {}
|
|
||||||
~on_exit() { f(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class... Ts>
|
|
||||||
struct overloaded : Ts...
|
|
||||||
{
|
|
||||||
using Ts::operator()...;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class... Ts>
|
|
||||||
overloaded(Ts...) -> overloaded<Ts...>;
|
|
||||||
|
|
||||||
inline const wchar_t* getScopeName(HKEY scope)
|
|
||||||
{
|
|
||||||
if (scope == HKEY_LOCAL_MACHINE)
|
|
||||||
{
|
|
||||||
return L"HKLM";
|
|
||||||
}
|
|
||||||
else if (scope == HKEY_CURRENT_USER)
|
|
||||||
{
|
|
||||||
return L"HKCU";
|
|
||||||
}
|
|
||||||
else if (scope == HKEY_CLASSES_ROOT)
|
|
||||||
{
|
|
||||||
return L"HKCR";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return L"HK??";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ValueChange
|
struct ValueChange
|
||||||
{
|
{
|
||||||
using value_t = std::variant<DWORD, std::wstring>;
|
using value_t = std::variant<DWORD, std::wstring>;
|
||||||
|
|||||||
Reference in New Issue
Block a user