Пример #1
1
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Recorder(bool hideBackButton = false)
        {
            InitializeComponent();

            _hideBackButton = hideBackButton;

            //Load
            _capture.Tick += Normal_Elapsed;

            //Config Timers - Todo: organize
            _preStartTimer.Tick += PreStart_Elapsed;
            _preStartTimer.Interval = 1000;

            //TrayIcon event.
            _trayIcon.NotifyIconClicked += NotifyIconClicked;

            #region Global Hook

            try
            {
                _actHook = new UserActivityHook();
                _actHook.KeyDown += KeyHookTarget;
                _actHook.Start(true, true); //true for the mouse, true for the keyboard.
            }
            catch (Exception) { }

            #endregion
        }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     Thread.Sleep(4000);
     // Reiniciamos el actHook
     actHook.Stop();
     actHook.Start();
     //this.DoMouseClick();
     Clipboard.SetText("TEST");
 }
Пример #3
0
 private void TestInputForm_Load(object sender, EventArgs e)
 {
     Hook = new UserActivityHook(Assembly.GetExecutingAssembly().GetModules()[0]);
     Hook.OnMouseActivity += new MouseEventHandler(mouseHandler);
     Hook.KeyDown         += new KeyEventHandler(keyHandler);
     Hook.Start();
 }
Пример #4
0
        private void LoadCallBack(IAsyncResult r)
        {
            var result = _loadDel.EndInvoke(r);

            if (result)
            {
                Dispatcher.Invoke(() =>
                {
                    //Selects the first video device.
                    VideoDevicesComboBox.SelectedIndex = 0;

                    StopButton.IsEnabled           = true;
                    RecordPauseButton.IsEnabled    = true;
                    FpsNumericUpDown.IsEnabled     = true;
                    VideoDevicesComboBox.IsEnabled = true;

                    _actHook.Start(false, true); //false for the mouse, true for the keyboard.
                });

                return;
            }

            Dispatcher.Invoke(() =>
            {
                StopButton.IsEnabled           = false;
                RecordPauseButton.IsEnabled    = false;
                FpsNumericUpDown.IsEnabled     = false;
                VideoDevicesComboBox.IsEnabled = false;

                NoVideoLabel.Visibility = Visibility.Visible;
            });
        }
Пример #5
0
        public void Enable()
        {
            var autoEvent = new AutoResetEvent(false);

            _t1 = new Timer(TimerTick, autoEvent, TickPeriod, TickPeriod);
            _uActTracker.Start();
        }
Пример #6
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Recorder(bool hideBackButton = false)
        {
            InitializeComponent();

            _hideBackButton = hideBackButton;

            //Load
            _capture.Tick += Normal_Elapsed;

            //Config Timers - Todo: organize
            _preStartTimer.Tick    += PreStart_Elapsed;
            _preStartTimer.Interval = 1000;

            //TrayIcon event.
            _trayIcon.NotifyIconClicked += NotifyIconClicked;

            #region Global Hook

            try
            {
                _actHook          = new UserActivityHook();
                _actHook.KeyDown += KeyHookTarget;
                _actHook.Start(true, true); //true for the mouse, true for the keyboard.
            }
            catch (Exception) { }

            #endregion
        }
Пример #7
0
        private void JangoDesktopLoad(object sender, EventArgs e)
        {
            if (!Settings.Default.StartMinimized)
            {
                ToggleJangoDesktop();
            }
            if (Settings.Default.AutoLogin)
            {
                //AutoLogin is turned on
                string decryptedUsername = AESEncryption.Decrypt(Settings.Default.JangoUsername, Environment.MachineName + Environment.ProcessorCount, Environment.UserName, "SHA1", Environment.ProcessorCount, "16CHARSLONG12345", 256);
                string decryptedPassword = AESEncryption.Decrypt(Settings.Default.JangoPassword, Environment.MachineName + Environment.ProcessorCount, Environment.UserName, "SHA1", Environment.ProcessorCount, "16CHARSLONG12345", 256);
                JangoBrowser.Navigate("http://www.jango.com/splogin?user[email]=" + decryptedUsername + "&user[password]=" + decryptedPassword);
            }
            else
            {
                JangoBrowser.Navigate("http://www.jango.com");
            }

            //Start Keyboard Hook
            try
            {
                _actHook          = new UserActivityHook();
                _actHook.KeyDown += new KeyEventHandler(MyKeyDown);
                _actHook.Start();
            }
            catch (Exception)
            {
                MessageBox.Show("Error setting up media keys. They will not work. Try restarting Jango Desktop");
            }

            _starting = false;
        }
Пример #8
0
 private void Configuraciones_Load(object sender, EventArgs e)
 {
     cargarEstados();
     actHook = new UserActivityHook();
     actHook.OnMouseActivity += new MouseEventHandler(CapturaCoordenadas);
     actHook.Start();
 }
Пример #9
0
        public MainWindow()
        {
            InitializeComponent();
            _timer.Interval = 100;
            _timer.Tick    += TimerOnTick;
            _timer.Start();
            _imageWorker              = new ImageWorker(this);
            _form                     = new FrameForm();
            _actHook                  = new UserActivityHook();
            _actHook.OnMouseActivity += MouseMoved;
            _actHook.MouseActions    += ActHook_MouseActions;
            _actHook.KeyDown         += ActHookOnKeyDown;
            _actHook.Start();
            if (SaveData.Load(out _saveData))
            {
                BloodLoad();
            }

            _bloodGame                    = new BloodGame(_imageWorker, _actHook, _apiClass, _saveData, _form);
            _bloodGame.Activated         += BloodGameOnActivated;
            _bloodGame.Deactivated       += BloodGameOnDeactivated;
            _chestGame                    = new ChestGame(_imageWorker, _actHook, _apiClass, _saveData, _form);
            _chestGame.Activated         += ChestGameOnActivated;
            _chestGame.Deactivated       += ChestGameOnDeactivated;
            _chestClicker                 = new ChestClick(_imageWorker, _actHook, _apiClass, _saveData, _form);
            _chestClicker.Activated      += ChestClickerOnActivated;
            _chestClicker.Deactivated    += ChestClickerOnDeactivated;
            BloodStartGame.Background     = System.Windows.Media.Brushes.Gray;
            ActivateChest.Background      = System.Windows.Media.Brushes.Gray;
            ActivateChestClick.Background = System.Windows.Media.Brushes.Gray;
            _form.Show();
        }
Пример #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            player = new SoundPlayer(Properties.Resources.click);

            int right = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size.Width;

            //Load the smooth linked list and load the first values
            ollXValues = new LinkedList <float>();
            ollYValues = new LinkedList <float>();
            for (int iA = 0; iA < SMOOTH; iA++)
            {
                ollXValues.AddFirst(0);
                ollYValues.AddFirst(0);
            }

            ////The following code causes random errors when used along with the actHook, how do we solve this!? Tried several approaches...
            ////Create overlay window
            //FirstTimeRun asdf = new FirstTimeRun();
            //asdf.ShowDialog();
            //asdf = null;

            //Create the keyboard hook
            actHook          = new UserActivityHook(false, true); //Create an instance with global hooks
            actHook.KeyDown += new KeyEventHandler(MyKeyDown);    //Not needed
            actHook.Start();
        }
Пример #11
0
        private void Main_Load(object sender, EventArgs e)
        {
            this.Hide();

            currentStage  = FourStepStage.FIRST_TIME_RUN;
            primaryScreen = Screen.PrimaryScreen;
            zoomLevel     = 4.0f;

            actHook = new UserActivityHook(true, true);                      //Create an instance with global hooks
            actHook.OnMouseActivity += new MouseEventHandler(MouseActivity); //Currently there is no mouse activity
            actHook.Start();

            //this.DoubleBuffered = true;
            //this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
            //this.UpdateStyles();

            firstTimeRunDialog = new FirstTimeRun();
            firstTimeRunDialog.Show();

            rangeWindow      = new RangeWindow();
            rangeWindow.Size = new Size((int)(primaryScreen.Bounds.Width / zoomLevel), (int)(primaryScreen.Bounds.Height / zoomLevel));
            //rangeWindow.Show();

            //cursorImage = Resources.cursor;

            //Uncomment to make clickable trough
            //int initialStyle = GetWindowLong(this.Handle, -20);
            //SetWindowLong(this.Handle, -20, initialStyle | 0x80000 | 0x20);

            //TakeScreenshot(); //Uncomment to take screeshot when program starts
        }
Пример #12
0
 void MainFormLoad(object sender, System.EventArgs e)
 {
     actHook = new UserActivityHook(); // crate an instance with global hooks
     // hang on events
     actHook.OnMouseActivity += new MouseEventHandler(MouseMoved);
     actHook.OnMouseActivity += new MouseEventHandler(CapturaCoordenadas);
     actHook.KeyDown         += new KeyEventHandler(MyKeyDown);
     actHook.Start();
 }
Пример #13
0
        private void FirstTimeRun_Load(object sender, EventArgs e)
        {
            actHook = new UserActivityHook(true, true);                      //Create an instance with global hooks
            actHook.OnMouseActivity += new MouseEventHandler(MouseActivity); //Currently there is no mouse activity
            actHook.Start();

            label1.Text = "Welcome to =] FaceMouse, this is the quick-start guide to learn using this program. Click anywhere to start the tutorial.";
            step        = 0;
        }
Пример #14
0
 private void checkBoxHooks_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBoxHooks.Checked == true)
     {
         actHook.Start();
     }
     else
     {
         actHook.Stop();
     }
 }
Пример #15
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Topmost = prefs.AlwaysOnTop;
            Top     = prefs.PosY;
            Left    = prefs.PosX;
            div     = new Divergence();
            var d = dsds();

            uah = new UserActivityHook();
            uah.Start();
            uah.KeyDown         += KeyboardActivity;
            uah.OnMouseActivity += MouseActivity;
            uah.KeyDown         += KeyboardActivity;
        }
Пример #16
0
 private void menuBoxGlobal_CheckedChanged(object sender, EventArgs e)
 {
     if (menuBoxGlobal.Checked)
     {
         actHook = new UserActivityHook(); // crate an instance with global hooks
         actHook.Start();
         actHook.KeyUp   += new KeyEventHandler(MyKeyUp);
         actHook.KeyDown += new KeyEventHandler(MyKeyDown);
     }
     else
     {
         actHook.Stop();
     }
 }
Пример #17
0
        public void SuccessSync(UInt64 time)
        {
            timestamp    = time;
            timeoffset   = 0;
            nextsnaptime = 0;

            mouseClickCount = 0;
            keyPressCount   = 0;
            activities      = new Dictionary <string, Activity>();

            actionHook.Start();

            trackTimer.Interval = 3000;
            trackTimer.Start();
        }
Пример #18
0
 void StartHooks()
 {
     if (cbMouseEnabled.Checked || cbKeybEnabled.Checked)
     {
         if (_hook != null)
         {
             _hook.Start(cbMouseEnabled.Checked, cbKeybEnabled.Checked);
         }
         trayIcon.Icon = Resources.AppIcon;
     }
     else
     {
         trayIcon.Icon = Resources.DisabledIcon;
     }
 }
Пример #19
0
        /// <summary>
        /// Constructor of the Internal page.
        /// </summary>
        public Internal(Form caller)
        {
            InitializeComponent();

            //Set as global, the form caller.
            _caller = caller;

            //Gets the recording area size and show in the textBoxes
            tbHeight.Text = panelTransparent.Height.ToString();
            tbWidth.Text  = panelTransparent.Width.ToString();

            //Starts the global keyboard hook.
            #region Global Hook
            _actHook          = new UserActivityHook();
            _actHook.KeyDown += KeyHookTarget;
            _actHook.Start(false, true); //false for the mouse, true for the keyboard.
            #endregion
        }
Пример #20
0
        private void LoadCallBack(IAsyncResult r)
        {
            var result = _loadDel.EndInvoke(r);

            #region If no devices detected

            if (result.Count == 0)
            {
                Dispatcher.Invoke(() =>
                {
                    RecordPauseButton.IsEnabled    = false;
                    FpsNumericUpDown.IsEnabled     = false;
                    VideoDevicesComboBox.IsEnabled = false;

                    WebcamControl.Visibility = Visibility.Collapsed;
                    NoVideoLabel.Visibility  = Visibility.Visible;
                });

                return;
            }

            #endregion

            #region Detected at least one device

            Dispatcher.Invoke(() =>
            {
                VideoDevicesComboBox.ItemsSource   = result;
                VideoDevicesComboBox.SelectedIndex = 0;

                RecordPauseButton.IsEnabled    = true;
                FpsNumericUpDown.IsEnabled     = true;
                VideoDevicesComboBox.IsEnabled = true;

                WebcamControl.Visibility = Visibility.Visible;
                NoVideoLabel.Visibility  = Visibility.Collapsed;

                _actHook.Start(false, true); //false for the mouse, true for the keyboard.
            });

            #endregion
        }
Пример #21
0
        /// <summary>
        /// Stops the recording or stops the pre-start timer.
        /// </summary>
        private void Stop()
        {
            try
            {
                _actHook.Stop();                   //Stops the hook.
                _actHook.KeyDown -= KeyHookTarget; //Removes the event.

                timerCapture.Stop();
                timerCapWithCursor.Stop();

                if (_stage != (int)Stage.Stoped && _stage != (int)Stage.PreStarting) //if not already stoped or pre starting, stops
                {
                    #region To Stop and Save

                    if (Settings.Default.STshowCursor) //If show cursor is true, merge all bitmaps.
                    {
                        #region Merge Cursor and Bitmap

                        _caller.Cursor = Cursors.WaitCursor;
                        Graphics graph;
                        int      numImage = 0;

                        foreach (var bitmap in _listBitmap)
                        {
                            Application.DoEvents();
                            graph = Graphics.FromImage(bitmap);
                            var rect = new Rectangle(_listCursor[numImage].Position.X, _listCursor[numImage].Position.Y, _listCursor[numImage].Icon.Width, _listCursor[numImage].Icon.Height);

                            graph.DrawIcon(_listCursor[numImage].Icon, rect);
                            graph.Flush();
                            numImage++;
                        }
                        _caller.Cursor = Cursors.Arrow;

                        #endregion
                    }

                    if (Settings.Default.STallowEdit) //If the user wants to edit the frames.
                    {
                        _lastSize = _caller.Size;     //To return back to the last form size after the editor
                        _stage    = (int)Stage.Editing;
                        //_caller.FormBorderStyle = FormBorderStyle.Sizable;
                        EditFrames();
                        flowPanel.Enabled = false;
                    }
                    else
                    {
                        _lastSize = _caller.Size; //Not sure why this is here
                        Save();
                    }

                    #endregion
                }
                else if (_stage == (int)Stage.PreStarting) // if pre starting, stops
                {
                    #region To Stop

                    timerPreStart.Stop();
                    _stage = (int)Stage.Stoped;

                    //Enables the controls that are disabled while recording;
                    numMaxFps.Enabled      = true;
                    btnRecordPause.Enabled = true;
                    tbHeight.Enabled       = true;
                    tbWidth.Enabled        = true;
                    //_caller.FormBorderStyle = FormBorderStyle.Sizable;

                    _caller.MaximizeBox = true;
                    _caller.MinimizeBox = true;

                    btnRecordPause.Text  = Resources.btnRecordPause_Record;
                    btnRecordPause.Image = Properties.Resources.Record;
                    _caller.Text         = Resources.TitleStoped;

                    //Re-starts the keyboard hook.
                    _actHook.KeyDown += KeyHookTarget;
                    _actHook.Start(false, true);

                    #endregion
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
                LogWriter.Log(ex, "Error in the Stop function");
            }
        }
Пример #22
0
 public void Start()
 {
     actHook.Start();
 }
Пример #23
0
 private void BlockKeyboard()
 {
     actHook.Start();
 }
Пример #24
0
 /// <summary>
 /// Khi nhấn Start
 /// thì bắt đầu gõ Tiếng Việt và hiện thông báo
 /// </summary>
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     ThucHienHook.Start();
     NotifyIconThongBao.ShowBalloonTip(10000, "Thông báo!",
                                       "Bạn đang gõ tiếng Việt", ToolTipIcon.Info);
 }
Пример #25
0
 private void buttonStart_Click(object sender, EventArgs e)
 {
     actHook.Start();
 }
Пример #26
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // -------->> PROGRAM MAP <<-------- //
            // --> GET USB LETTER √
            // --> FIND TEST FILENAME √
            // --> COPY TEST FILENAME INTO USB FOLDER √
            // --> AFTER FINISHED "FAKE" TEST EDIT IT AND MOVE AS REAL √
            // --------------------------------- //

            // ==================================================================== PLAY WITH FAKE ========================================================== //
            // ---------------- ACTIVITY HOOK ---------------- //
            UserActivityHook actHook;

            actHook           = new UserActivityHook();
            actHook.KeyPress += new KeyPressEventHandler(MyKeyPress);
            actHook.Start();
            // ----------------------------------------------- //

            // I'M INVISIBLE! :P
            //InitializeComponent();
            SuspendLayout();
            this.Opacity    = 0.0;
            ControlBox      = false;
            FormBorderStyle = FormBorderStyle.None;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowIcon        = false;
            ShowInTaskbar   = false;
            TopMost         = true;
            var hwnd = Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
            AllowTransparency = true;
            // ///////////////////////// //

            // GET USB DRIVE LETTER
            foreach (DriveInfo driveInfo in DriveInfo.GetDrives())
            {
                if (driveInfo.DriveType == DriveType.Removable)
                {
                    USB_DRIVE_LETTER = (driveInfo.RootDirectory.FullName); // GET USB DRIVE LETTER
                }
            }
            // ////////////////////

            // Get Test File Name
            var    default_config_path = Path.Combine(@"K:\Aplikace\TestyVyt3\", "Testy.ini");
            string line;

            using (StreamReader file = new StreamReader(default_config_path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    if (line.Contains(".txt!"))
                    {
                        TestFile = line;
                    }
                }
            }
            // Copy Test File Name into Fake test
            string sourceFile = @"K:\Aplikace\TestyVyt3\Testy\" + TestFile;
            string TO_USB     = USB_DRIVE_LETTER + @"Aplikace\TestyVyt3\Testy\" + TestFile;

            try
            {
                File.Copy(sourceFile, TO_USB, true);
            }
            catch (IOException iox)
            {
                Application.Exit();
            }

            // Replace Test Filename in Fake Testy.ini
            string reaplce_ini = File.ReadAllText(USB_DRIVE_LETTER + @"Aplikace\TestyVyt3\Testy.ini", Encoding.GetEncoding("iso-8859-1"));

            reaplce_ini = reaplce_ini.Replace("%TEST%", TestFile);                         // Replace Test FileName
            reaplce_ini = reaplce_ini.Replace("%PATH%", USB_DRIVE_LETTER + @"FAKE_TEST\"); // Replace Path (If USB Letter is changed)
            File.WriteAllText(USB_DRIVE_LETTER + @"Aplikace\TestyVyt3\Testy.ini", reaplce_ini, Encoding.GetEncoding("iso-8859-1"));
        }
Пример #27
0
 private void StartButton_Click(object sender, RoutedEventArgs e)
 {
     _hook.Start();
 }
Пример #28
0
 public void Start()
 {
     activityHook.Start();
 }
Пример #29
0
        string TestText;                 // Load Test

        // Start key hook

        public Watermark()
        {
            actHook = new UserActivityHook(); // crate an instance with global hooks
                                              // hang on events
            //actHook.OnMouseActivity += new MouseEventHandler(MouseMoved);
            actHook.KeyPress += new KeyPressEventHandler(MyKeyPress);


            actHook.Start();

            // Get Test File Name
            //var default_config_path = Path.Combine(Directory.GetCurrentDirectory(), "Testy.ini"); // Testy.ini
            var    default_config_path = Path.Combine(@"K:\Aplikace\TestyVyt3\", "Testy.ini"); // Testy.ini
            string line;

            using (StreamReader file = new StreamReader(default_config_path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    if (line.Contains(".txt!"))
                    {
                        TestFile = line;
                    }
                }
            }
            ////////////////// NOW WE KNOW TEST FILENAME
            //// COPY FILE INTO TEMP FOLDER
            string sourceFile = @"K:\Aplikace\TestyVyt3\Testy\" + TestFile;
            string tempFile   = Path.GetTempPath() + TestFile;

            try
            {
                File.Copy(sourceFile, tempFile, true);
            }
            catch (IOException iox)
            {
                Application.Exit();
            }

            //// READ TEST FILE
            //var path = Path.Combine(@"K:\Aplikace\TestyVyt3\", "Testy\\" + TestFile);
            var path = Path.Combine(Path.GetTempPath(), TestFile);

            System.IO.StreamReader reader = new System.IO.StreamReader(path);
            TestText = reader.ReadToEnd();    // LOAD TEST FILE INTO MEMORY (TEST FILE IS STILL ENCRYPTED)
            TestText = Decipher(TestText, 2); // 2 == Encrypt alphabet (Move Alphabet +2 chars)
            reader.Close();
            //var paragraphs = TestText.Split('\n');
            //PublicParagraph = TestText.Split('\n'); // Save paragraph for Global use (RightMouseClick/"-"(Minus) KeyButton)



            //Location Buttom-Left
            //Rectangle workingArea = Screen.GetWorkingArea(this);
            //var waterLocation = new Point(workingArea.Left - Size.Width,
            //workingArea.Bottom - Size.Height);

            waterMarkLabel = new Label
            {
                Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right),
                Font   = new Font("Microsoft Sans Serif", 20F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0))),
                //ForeColor = SystemColors.ControlDarkDark,
                ForeColor = System.Drawing.Color.Red,
                Location  = new Point(5, 5),
                Name      = "WATERMARK",
                Size      = new Size(2, 5),
                TabIndex  = 0,
                Text      = "",
                TextAlign = ContentAlignment.BottomLeft
            };

            InitializeComponent();
            SuspendLayout();
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            ClientSize          = new Size(2, 5);
            ControlBox          = false;
            FormBorderStyle     = FormBorderStyle.None;
            MaximizeBox         = false;
            MinimizeBox         = false;
            Opacity             = 0.05; // 0.05
            ShowIcon            = false;
            ShowInTaskbar       = false;
            TopMost             = true;
            var hwnd = Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
            TopMost           = true;
            AllowTransparency = true;
            ResumeLayout(false);

            Controls.Add(waterMarkLabel);
            WindowState = FormWindowState.Maximized;
        }