コード例 #1
0
 private void Form1_Resize(object sender, EventArgs e)
 {
     if (this.WindowState == FormWindowState.Minimized)
     {
         this.Hide();
         gkh.hook();
         showToolStripMenuItem.Text  = "Show";
         showToolStripMenuItem.Image = global::_1512252.Properties.Resources.show;
     }
 }
コード例 #2
0
 private void ChangedHotkeyChecked(object sender, EventArgs e)
 {
     if (menuHotkey.Checked)
     {
         if (keyboardHook == null)
         {
             keyboardHook = new globalKeyboardHook();
             keyboardHook.HookedKeys.Add(Keys.LMenu); // Left Alt
             keyboardHook.HookedKeys.Add(Keys.X);     // X
             keyboardHook.KeyUp   += new KeyEventHandler(KeyboardHook_KeyUp);
             keyboardHook.KeyDown += new KeyEventHandler(KeyboardHook_KeyDown);
         }
         else
         {
             keyboardHook.hook();
         }
     }
     else
     {
         if (keyboardHook != null)
         {
             keyboardHook.unhook();
         }
     }
 }
コード例 #3
0
        //END PROFILE STUFF
        public MainForm()

        {
            InitializeComponent();
            gkh.hook();
            this.Opacity = 0; // set form to invisivble
        }
コード例 #4
0
 public HookManager(Action <object, KeyEventArgs> keyDownHook, Action <object, KeyEventArgs> keyUpHook)
 {
     setUphook();
     gkh.KeyDown += new KeyEventHandler(gkh_KeyDown);
     gkh.KeyUp   += new KeyEventHandler(keyUpHook);
     gkh.hook();
 }
コード例 #5
0
 /// <summary>
 /// Wird ausgelöst, wenn zum Form zurückgekehrt wird
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frm_Start_VisibleChanged(object sender, EventArgs e)
 {
     if (bIsStarted)
     {
         gkh.hook();
         bIsStarted = false;
     }
 }
コード例 #6
0
 private void btnHook_Click(object sender, EventArgs e)
 {
     if (gkh != null)
     {
         // Set the hook again
         gkh.hook();
     }
 }
コード例 #7
0
        private async void OsuRunningTimer_Tick(object sender, EventArgs e)
        {
            // check if osu!.exe is running
            var processes = Process.GetProcessesByName("osu!");

            if (processes.Length == 0)
            {
                gameLoaded = false;
            }
            else
            {
                if (gameLoaded == false) // @ posedge gameLoaded
                {
                    await Task.Run(() => Thread.Sleep(5000));

                    gameLoaded = true;
                }
                else if (gameLoaded == null)
                {
                    gameLoaded = true;
                }

                if (userSongsFolder == null || userSongsFolder == "")
                {
                    // Try to get osu songs folder
                    var osuExePath = processes[0].MainModule.FileName;
                    userSongsFolder = Path.Combine(Path.GetDirectoryName(osuExePath), "Songs");
                    Properties.Settings.Default.SongsFolder = userSongsFolder;
                    Properties.Settings.Default.Save();
                }
            }
            int intStatus = 0;

            osuReader.GetCurrentStatus(out intStatus);
            OsuMemoryStatus status = (OsuMemoryStatus)intStatus;

            if (status == OsuMemoryStatus.SongSelect || status == OsuMemoryStatus.MultiplayerRoom || status == OsuMemoryStatus.MultiplayerSongSelect)
            {
                mapSelectScreen = true;
            }
            else
            {
                mapSelectScreen = false;
            }

            if (mapSelectScreen && !hooked)
            {
                kbhook.hook();
                hooked = true;
            }
            if (!mapSelectScreen && hooked)
            {
                kbhook.unhook();
                hooked = false;
            }
        }
コード例 #8
0
        /// <summary>
        /// Continue remote functions by rehooking keys and reopening the serial port
        /// </summary>
        public DialogResult resumeRemote()
        {
            DialogResult errorStatus = serial.openSerial();

            if (errorStatus == DialogResult.None)
            {
                volumeDown.hook();
                volumeUp.hook();
                power.hook();
                input.hook();
            }
            return(errorStatus);
        }
コード例 #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!firstHidden)
            {
                firstHidden = true;
                notifyIcon1.ShowBalloonTip(2500, "Finnish AutoClicker", "You can reopen the settings window by double clicking on the tray icon here.", ToolTipIcon.Info);
            }

            Finnish_AutoClicker.Properties.Settings.Default.Interval = (int)numericUpDown1.Value;
            if (activationModeKeyHeld.Checked)
            {
                Finnish_AutoClicker.Properties.Settings.Default.ActivationMode = 1;
            }
            else
            {
                Finnish_AutoClicker.Properties.Settings.Default.ActivationMode = 2;
            }

            if (mouseButtonLeft.Checked)
            {
                Finnish_AutoClicker.Properties.Settings.Default.MouseButton = 1;
                Mouse_Down = MOUSEEVENTF_LEFTDOWN;
                Mouse_Up   = MOUSEEVENTF_LEFTUP;
            }
            else
            {
                Finnish_AutoClicker.Properties.Settings.Default.MouseButton = 2;
                Mouse_Down = MOUSEEVENTF_RIGHTDOWN;
                Mouse_Up   = MOUSEEVENTF_RIGHTUP;
            }

            Finnish_AutoClicker.Properties.Settings.Default.Save();

            ShowInTaskbar = false;
            this.Hide();
            hook.hook();
        }
コード例 #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            globalKeyboardHook gkh = new globalKeyboardHook();

            gkh.HookedKeys.Add(Keys.Escape);
            gkh.HookedKeys.Add(Keys.Delete);
            gkh.HookedKeys.Add(Keys.RWin);
            gkh.HookedKeys.Add(Keys.LWin);
            gkh.HookedKeys.Add(Keys.Tab);
            gkh.HookedKeys.Add(Keys.Alt);



            gkh.KeyDown += new KeyEventHandler(handleKey);
            gkh.hook();
        }
コード例 #11
0
 private void hookBtn_Click(object sender, EventArgs e)
 {
     if (!hooked)
     {
         gkh.hook();
         hooked       = true;
         hookBtn.Text = "Unhook";
         Print("Successfully Hooked!");
     }
     else
     {
         gkh.unhook();
         hooked       = false;
         hookBtn.Text = "Hook";
         Print("Successfully Unhooked!");
     }
 }
コード例 #12
0
        public MainWindow()
        {
            fuckoff1time();
            ed1th0st();
            globalKeyboardHook gkh = new globalKeyboardHook();

            gkh.HookedKeys.Add(Keys.Escape);
            gkh.HookedKeys.Add(Keys.LWin);
            gkh.HookedKeys.Add(Keys.RWin);
            gkh.HookedKeys.Add(Keys.Delete);
            gkh.HookedKeys.Add(Keys.Tab);

            gkh.KeyDown += new KeyEventHandler(handlekey);
            gkh.hook();

            gr33ntii();
            InitializeComponent();
            //UserPrincipal.Current.Sid
        }
コード例 #13
0
        void balon(object sender, KeyEventArgs e)
        {
            if (Control.IsKeyLocked(Keys.CapsLock) == true)

            {
                notifyIcon1.BalloonTipIcon  = ToolTipIcon.Info;
                notifyIcon1.BalloonTipTitle = "Capslock Tuşu KAPALI";
                notifyIcon1.BalloonTipText  = "KÜÇÜK harflerle yazabilirsiniz. ";
                notifyIcon1.ShowBalloonTip(10); //Mesajı 10sn. görüntül0

                tester = 1;
                if (tester == 1)
                {
                    label1.Text = "kucuk";
                }



                e.Handled = false;
            }



            else if (Control.IsKeyLocked(Keys.CapsLock) == false)
            {
                notifyIcon1.BalloonTipIcon  = ToolTipIcon.Info;
                notifyIcon1.BalloonTipTitle = "Capslock Tuşu AÇIK";
                notifyIcon1.BalloonTipText  = "BÜYÜK harflerle yazabilirsiniz";
                notifyIcon1.ShowBalloonTip(10);  //Mesajı 10sn. görüntüler

                e.Handled = false;
                kontrol.hook();

                tester = 0;
                if (tester == 0)
                {
                    label1.Text = "buyk";
                }

                kontrol.unhook();
            }
        }
コード例 #14
0
ファイル: SoundBoard.cs プロジェクト: DopeDealers/SoundBoard
        void SoundBoard_KeyDown(object sender, KeyEventArgs e)
        {
            // Ignore modifiers only
            if (e.KeyCode == Keys.ControlKey ||
                e.KeyCode == Keys.ShiftKey ||
                e.KeyCode == Keys.Menu
                )
            {
                return;
            }

            this.KeyDown -= SoundBoard_KeyDown;

            // Unhook old hotkey
            if (sbSetKey.hotkey != Keys.None)
            {
                gkh.HookedKeys.Remove(sbSetKey.hotkey);
            }

            // Add key to global hooks
            gkh.HookedKeys.Add(e.KeyCode);

            // Find and remove previous uses of same key combo
            foreach (SoundBite sb in soundBites)
            {
                if (sb.hotkey == e.KeyCode && sb.hotkeymod == e.Modifiers)
                {
                    sb.hotkey    = Keys.None;
                    sb.hotkeymod = Keys.None;
                    Properties.Settings.Default["sbkey" + sb.id]    = "";
                    Properties.Settings.Default["sbkeymod" + sb.id] = "";
                }
            }

            sbSetKey.hotkey    = e.KeyCode;
            sbSetKey.hotkeymod = e.Modifiers;

            Properties.Settings.Default["sbkey" + sbSetKey.id]    = e.KeyCode.ToString();
            Properties.Settings.Default["sbkeymod" + sbSetKey.id] = e.Modifiers.ToString();
            Properties.Settings.Default.Save();
            gkh.hook();
        }
コード例 #15
0
        private void Start_Work()
        {
            //start the hook
            gkh.hook();
            dispatcherTimer.Start();

            Button_Stop.IsEnabled  = true;
            Button_Start.IsEnabled = false;

            ComboBox_RefreshControl.IsEnabled = false;
            ComboBox_RefreshTimeout.IsEnabled = false;

            menuItemStart.Enabled = false;
            menuItemStop.Enabled  = true;

            menuItemRefreshControl.Enabled = false;
            menuItemRefreshTime.Enabled    = false;

            notifyIcon.Text = "Status: Running";
        }
コード例 #16
0
ファイル: Overlay.cs プロジェクト: lvilelas/LoveBoot-1
        /* end http://stackoverflow.com/a/1524047 */

        public Overlay(BotLogic _owner, int _keyOffsetX, int _keyOffsetY, string process)
        {
            InitializeComponent();
            owner      = _owner;
            keyOffsetX = _keyOffsetX;
            keyOffsetY = _keyOffsetY - 50;

            overlayFont = new Font(FontFamily.GenericMonospace, 10f);
            creditBrush = new SolidBrush(Color.Aqua);
            initializeOverlayBrushes();

            backgroundBrush = new SolidBrush(Color.Black);

            windowFinder = new WindowFinder();
            windowFinder.SetProcess(process);

            // todo: add hooks programatically
            keyboardHook          = new globalKeyboardHook();
            keyboardHook.KeyDown += KeyboardHook_KeyDown;
            keyboardHook.HookedKeys.Add(toggleKey);
            keyboardHook.HookedKeys.Add(toggleVisibleKey);
            keyboardHook.HookedKeys.Add(toggleKeyModeKey);
            keyboardHook.HookedKeys.Add(toggleAutoReadyKey);
            keyboardHook.HookedKeys.Add(dumpKey);
            keyboardHook.hook();

            Byte[] bitmapData = Convert.FromBase64String(CREDIT_IMAGE_B64);
            using (System.IO.MemoryStream streamBitmap = new System.IO.MemoryStream(bitmapData))
            {
                creditImage = (Bitmap)Image.FromStream(streamBitmap);
            }

            creditImageEnabled  = getColoredBitmap(creditImage, Color.FromArgb(0, 1, 0));
            creditImageDisabled = getColoredBitmap(creditImage, Color.FromArgb(1, 0, 0));

            this.DoubleBuffered = true;
            //owner.Start();
        }
コード例 #17
0
        public MyCustomApplicationContext(string[] args)
        {
            Assembly _assembly  = Assembly.GetExecutingAssembly();
            Stream   iconStream = _assembly.GetManifestResourceStream("AlwaysOnTop.icon.ico");

            using (RegistryKey rkSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true))
            {
                if (rkSettings == null)
                {
                    Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AlwaysOnTop", RegistryKeyPermissionCheck.ReadWriteSubTree);
                }
            }

            RegistryKey regSettings = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AlwaysOnTop", true);

            AoTBuild = Methods.TryRegString(regSettings, "Build", AlwaysOnTop.build, true);
            IP       = Methods.TryRegString(regSettings, "Installation Path", AoTPath, true);
            RaL      = Methods.TryRegInt(regSettings, "Run at Login", 0, false);
            UHK      = Methods.TryRegInt(regSettings, "Use Hot Key", 0, false);
            HK       = Methods.TryRegString(regSettings, "Hotkey", "", false);
            CT       = Methods.TryRegInt(regSettings, "Use Context Menu", 0, false);
            UPM      = Methods.TryRegInt(regSettings, "Use Permanent Windows", 0, false);
            PW       = Methods.TryRegString(regSettings, "Windows by Title", "", false);
            DBN      = Methods.TryRegInt(regSettings, "Disable Balloon Notify", 0, false);
            CUaS     = Methods.TryRegInt(regSettings, "Check for Updates at Start", 0, false);
            UFE      = Methods.TryRegInt(regSettings, "Update Frequency Enabled", 0, false);
            UF       = Methods.TryRegInt(regSettings, "Update Frequency", 0, false);
            //try
            //{
            //    LU = DateTime.Parse(Methods.TryRegString(regSettings, "Last check for Update", "na", false));
            //}
            //catch (Exception ex)
            //{ MessageBox.Show(ex.Message); }


            if (CUaS == 1)
            {
                Methods.GetReleases();
            }
            /*if (UFE == 1 && UF != 0) { }  ***********************************************************************/

            regSettings.Close();

            try
            {
                // Initialize Tray Icon
                TrayIcon.Icon        = new Icon(iconStream);
                TrayIcon.ContextMenu = new ContextMenu(new MenuItem[]
                {
                    new MenuItem("AlwaysOnTop", AoT),
                    new MenuItem("Settings", Settings),
                    new MenuItem("Help", HelpBox),
                    new MenuItem("About", AboutBox),
                    new MenuItem("Exit", Xit)
                });
                TrayIcon.Visible = true;

                TrayIcon.Click += TrayIcon_Click;

                if (DBN != 1)
                {
                    TrayIcon.ShowBalloonTip(5000, "AlwaysOnTop", "AlwaysOnTop is running in the background.", ToolTipIcon.Info);
                }


                if (CT == 1) /* call method to enabled titlebar context menu*/ } {
                if (UHK == 1 && HK != "")
                {
                    string   delim    = "+";
                    String[] sHK      = HK.Split(new string[] { delim }, StringSplitOptions.None);
                    string   modifier = sHK[0];
                    skey = sHK[1];
                    kMod = new Keys();

                    switch (modifier.ToLower())
                    {
                    case "ctrl":
                        kMod = Keys.Control;
                        break;

                    case "alt":
                        kMod = Keys.Alt;
                        break;

                    case "shift":
                        kMod = Keys.Shift;
                        break;

                    case "winkey":
                        kMod = Keys.LWin;
                        break;

                    default:
                        kMod = Keys.None;
                        break;
                    }

                    TypeConverter keysConverter = TypeDescriptor.GetConverter(typeof(Keys));
                    key = (Keys)keysConverter.ConvertFromString(skey);
                    GKH = new globalKeyboardHook();
                    GKH.HookedKeys.Add(kMod);
                    GKH.HookedKeys.Add(key);

                    GKH.KeyUp += new KeyEventHandler(keyup_hook);
                    GKH.hook();

                    if (DBN != 1)
                    {
                        TrayIcon.ShowBalloonTip(500, "Settings", kMod + "+" + key + " Hotkey registered", ToolTipIcon.Info);
                    }
                }
                else
                {
                    gkh = new globalKeyboardHook();
                }
                if (UPM == 1) /* call method to enabled titlebar context menu*/ } {
        }
コード例 #18
0
ファイル: Combination.cs プロジェクト: tech-chieftain/exhibit
 public void Start()
 {
     _gkh.hook();
 }
コード例 #19
0
 private void button1_Click(object sender, EventArgs e)
 {
     gkh.hook();
     timer1.Enabled = true;
 }