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