Files

30 lines
764 B
C++

#pragma once
#include "RegistryConfig.h"
#include <windows.h>
#include <string>
namespace hook
{
class ProcessLauncher
{
public:
ProcessLauncher() = default;
~ProcessLauncher();
ProcessLauncher(const ProcessLauncher&) = delete;
ProcessLauncher& operator=(const ProcessLauncher&) = delete;
bool Start(const LaunchConfig& config, bool loggingEnabled, const std::wstring& sourceName);
void Stop(bool loggingEnabled, const std::wstring& sourceName = L"Programm");
void Detach(bool loggingEnabled, const std::wstring& sourceName = L"Programm");
bool IsRunning();
private:
HANDLE process_ = nullptr;
DWORD processId_ = 0;
void CleanupExitedProcess();
};
}