#ifndef ZOOST_OS_WIN_H #define ZOOST_OS_WIN_H #include #include class zoostWinService { public: static std::string GetLastErrorMsg(); static bool WinInstallService(); static bool WinUninstallService(); static bool WinStartService(); static bool WinStopService(); static void WinServiceRun(); static void ExportEventMsg(const std::string& msg); public: // 服务名称。 static std::string serviceName_; // 服务描述 static std::string dispName_; // 程序路径 static std::string exePath_; // 默认 5000 毫秒执行一次 exeFunc_。 static unsigned int timeoutVal; // exeFunc_ 是周期执行的函数,必须设定,不能为空指针。 static std::function exeFunc_; // stopFunc_ 必须设定,不能为空指针。 static std::function stopFunc_; }; class zoostWinUtil { public: zoostWinUtil() = default; ~zoostWinUtil() = default; public: static std::string U82Ansi(const std::string& str); static std::string Ansi2U8(const std::string& str); }; #endif // ZOOST_OS_WIN_H