Beispiel #1
0
        private static void HandleWinEvent(
            IntPtr eventHook, Events type,
            IntPtr hwnd, int idObject,
            int child, uint thread, uint time)
        {
            switch (type)
            {
            case Events.SystemMinimizeStart:
                WebsocketService.SendMessage(WebsocketService.PushWin32Event, new Win32Event <int> {
                    Event = "minimize",
                    Value = 0,
                });
                break;

            case Events.SystemMinimizeEnd:
                WebsocketService.SendMessage(WebsocketService.PushWin32Event, new Win32Event <int> {
                    Event = "restore",
                    Value = 0,
                });
                break;

            case Events.SystemForeground:
                break;

            case Events.ObjectLocationChange:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Beispiel #2
0
        private static void WatchProcessExit(int pid)
        {
            var p = Process.GetProcessById(pid);

            p.EnableRaisingEvents = true;
            p.Exited += (sender, args) => {
                WebsocketService.SendMessage(WebsocketService.PushWin32Event, new Win32Event <int> {
                    Event = "exit",
                    Value = pid,
                }, false);
            };
        }
Beispiel #3
0
 private static void OnTextractorOutput(TextOutputObject output)
 {
     WebsocketService.SendMessage(WebsocketService.PushTextractorResult, output);
 }