public void Load() { Logger.Debug("Loading DebugHelper input hooks"); process = new Process { StartInfo = new ProcessStartInfo(Path.Combine(Path.GetDirectoryName(typeof(DebugHelperMouseHookManager).Assembly.Location), "Blish HUD.DebugHelper.exe"), Process.GetCurrentProcess().Id.ToString()) { RedirectStandardInput = true, RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true } }; Logger.Debug($"Starting external process: {process.StartInfo.FileName}"); process.Start(); debugHelperMessageService = new StreamMessageService(process.StandardOutput.BaseStream, process.StandardInput.BaseStream); debugHelperMessageService.Start(); pingTimer = new Timer(10) { AutoReset = true }; pingTimer.Elapsed += (s, e) => debugHelperMessageService.Send(new PingMessage()); pingTimer.Start(); mouseHookManager = new DebugHelperMouseHookManager(debugHelperMessageService); keyboardHookManager = new DebugHelperKeyboardHookManager(debugHelperMessageService); }
public WinApiHookManager() { mouseHookManager = new WinApiMouseHookManager(); keyboardHookManager = new WinApiKeyboardHookManager(); }