Exemple #1
0
 public ActionController(IntPtr hookedInstance, IActionView actionView, RecordStrategies recordStrategy)
 {
     try
     {
         switch (recordStrategy)
         {
             case RecordStrategies.Mouse:
                 actionStrategy = new MActionStrategy();
                 break;
             case RecordStrategies.Keyboard:
                 actionStrategy = new KBActionStrategy();
                 break;
             case RecordStrategies.MouseAndKeyboard:
                 actionStrategy = new KBMActionStrategy();
                 break;
             default:
                 break;
         }
         this.actionView = actionView;
     }
     catch (Exception ex)
     {
         ExceptionLogger.LogException(ex);
     }
     
 }
Exemple #2
0
 private void rdb_Click(object sender, RoutedEventArgs e)
 {
     if (rdbMouseAndKeyboard.IsChecked == true)
     {
         this.recordStrategy = RecordStrategies.MouseAndKeyboard;
     }
     else if (rdbMouse.IsChecked == true)
     {
         this.recordStrategy = RecordStrategies.Mouse;
     }
     else if (rdbKeyboard.IsChecked == true)
     {
         this.recordStrategy = RecordStrategies.Keyboard;
     }
 }
Exemple #3
0
 public ActionController(IActionView actionView, RecordStrategies recordStrategy)
     : this(Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), actionView,recordStrategy)
 {
 }
Exemple #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            recordStrategy = RecordStrategies.MouseAndKeyboard;

            IntPtr hwnd = new WindowInteropHelper(this).Handle;
            if (hwnd != IntPtr.Zero)
            {
                HwndSource.FromHwnd(hwnd).AddHook(new HwndSourceHook(this.MessageHookHandler));
            }
            Win32API.RegisterHotKey((new WindowInteropHelper(this)).Handle, 247696411, 0, (UInt32)Keys.F10); //注册热键 
        }