Exemple #1
0
 public TestMouseHook(MonitorHookFactory mhf)
 {
     InitializeComponent();
     _mhf  = mhf;
     _hook = _mhf.GetMouseObserver();
     _hook.Start();
     _hook.OnMouseInput += UpDate;
     _upd = ToList;
     ShowDialog();
 }
 public TestAppHook(MonitorHookFactory mhf)
 {
     InitializeComponent();
     _mhf  = mhf;
     _upd  = ToList;
     _hook = _mhf.GetApplicationObserver();
     _hook.Start();
     _hook.OnAppWindowChange += UpDate;
     ShowDialog();
 }
 public TestPrintHook(MonitorHookFactory mhf)
 {
     InitializeComponent();
     _mhf  = mhf;
     _upd  = ToList;
     _hook = _mhf.GetPrintObserver();
     _hook.Start();
     _hook.OnPrintEvent += UpDate;
     ShowDialog();
 }
 public TestKeyBoardHook(MonitorHookFactory mhf)
 {
     InitializeComponent();
     _mhf  = mhf;
     _upd  = ToList;
     _hook = _mhf.GetKeyboardObserver();
     _hook.Start();
     _hook.OnKeyInput += UpDate;
     ShowDialog();
 }
 public TestClipBordHook(MonitorHookFactory mhf)
 {
     InitializeComponent();
     _mhf  = mhf;
     _upd  = ToList;
     _hook = _mhf.GetClipboardObserver();
     _hook.Start();
     _hook.OnClipboardModified += UpDate;
     ShowDialog();
 }
Exemple #6
0
        static void Main(string[] args)
        {
            var monitorHookFactory = new MonitorHookFactory();

            //var kOM = monitorHookFactory.GetKeyboardObserver();
            //kOM.Start();
            //kOM.OnKeyInput += (s, e) =>
            //    { Console.WriteLine($"Key{e.Key.EventType} event of key{e.Key.KeyName}"); };
            //Thread.Sleep(1000);

            //var mOM = monitorHookFactory.GetMouseObserver();
            //mOM.Start();
            //mOM.OnMouseInput += (s, e) =>
            //    {
            //        Console.WriteLine($"Mouse info {e.MouseInfo} at point {e.Point} msg{e.MouseMessage}");
            //    };

            var cOM = monitorHookFactory.GetClipboardObserver();

            cOM.Start();
            cOM.OnClipboardModified += (s, e) =>
            {
                Console.WriteLine("Clipboard updated with data '{0}' of format {1}", e.Data,
                                  e.DataFormat.ToString());
            };

            //var aOM = monitorHookFactory.GetApplicationObserver();
            //aOM.Start();
            //aOM.OnAppWindowChange += (s, e) =>
            //{
            //    Console.WriteLine("Application '{0}' window of '{1}' with the title '{2}' was {3}",
            //        e.WindowInfo.AppPath,e.WindowInfo.AppName, e.WindowInfo.AppTitle, e.Events);
            //};
            Console.Read();
            //kOM.Stop();
            //mOM.Stop();
            cOM.Stop();
            //aOM.Stop();
        }