Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public WinApiHookManager()
 {
     mouseHookManager    = new WinApiMouseHookManager();
     keyboardHookManager = new WinApiKeyboardHookManager();
 }