#pragma once #include namespace config { inline constexpr wchar_t kConfigKey[] = L"Software\\Plandent\\MstscScriptHook"; inline constexpr wchar_t kAddInKey[] = L"Software\\Microsoft\\Terminal Server Client\\Default\\AddIns\\PlandentMstscScriptHook"; struct HookConfig { bool enabled = true; bool enableLogging = true; std::wstring scriptPath; std::wstring arguments; std::wstring workingDirectory; bool startOnConnect = true; bool stopOnDisconnect = false; bool hidden = true; bool preventDuplicates = true; bool triggerEnabled = false; std::wstring triggerProgramPath; std::wstring triggerArguments; std::wstring triggerWorkingDirectory; bool triggerHidden = true; bool triggerPreventDuplicates = true; }; HookConfig Load(); bool Save(const HookConfig& value, std::wstring& error); std::wstring GetRegisteredPluginPath(); bool RegisterPlugin(const std::wstring& dllPath, std::wstring& error); bool UnregisterPlugin(std::wstring& error); std::wstring ExpandEnvironment(const std::wstring& value); }