#pragma once #include #include namespace testlaunch { struct LaunchSettings { std::wstring path; std::wstring arguments; std::wstring workingDirectory; bool hidden = true; }; class TestProcess { public: ~TestProcess(); TestProcess(const TestProcess&) = delete; TestProcess& operator=(const TestProcess&) = delete; TestProcess() = default; bool Start(const LaunchSettings& settings, std::wstring& error); bool Stop(std::wstring& error); bool IsRunning(); DWORD ProcessId() const { return processId_; } void Detach(); private: HANDLE process_ = nullptr; DWORD processId_ = 0; void CleanupExited(); }; }