#pragma once #include #include #include #include #include #include #include struct PowertoyModuleDeleter { void operator()(PowertoyModuleIface* module) const { if (module) { module->destroy(); } } }; struct PowertoyModuleDLLDeleter { using pointer = HMODULE; void operator()(HMODULE handle) const { FreeLibrary(handle); } }; class PowertoyModule { public: PowertoyModule(PowertoyModuleIface* module, HMODULE handle); inline PowertoyModuleIface* operator->() { return module.get(); } json::JsonObject json_config() const; private: std::unique_ptr handle; std::unique_ptr module; }; PowertoyModule load_powertoy(const std::wstring_view filename); std::map& modules();