コード例 #1
0
 public Form1()
 {
     InitializeComponent();
     _form_master = this;
     rdbMouseAbs.CheckedChanged     += rdbMouse_CheckedChanged;
     rdbMouseAbsResc.CheckedChanged += rdbMouse_CheckedChanged;
     rdbMouseRel.CheckedChanged     += rdbMouse_CheckedChanged;
     keyboardListener = new Hooks.KeyboardListener(globalHooks, hotKeySuite);
     mouseListener    = new Hooks.MouseListener(globalHooks);
 }
コード例 #2
0
        //abilita/disabilita hooking mouse e tastiera
        private void btnHook_Click(object sender, EventArgs e)
        {
            if (!hook_listening)
            {
                updateMouseTypeMovement();
                if (radioButtonHookGlobal.Checked)
                {
                    keyboardListener = new Hooks.KeyboardListener(globalHooks, hotKeySuite);
                    mouseListener    = new Hooks.MouseListener(globalHooks);
                    //globalHooks.Subscribe(CommonClasses.Win32.HookType.WH_KEYBOARD_LL,
                }
                else if (radioButtonHookLocal.Checked)
                {
                }

                btnHook.Text = "Sospendi eventi";
            }
            else
            {
                keyboardListener.Dispose();
                mouseListener.Dispose();
                btnHook.Text = "Intercetta eventi";
            }

            hook_listening = !hook_listening;
            radioButtonHookGlobal.Enabled = !hook_listening;
            radioButtonHookLocal.Enabled  = !hook_listening;

            /*new Thread(() =>
             * {
             *  CommonClasses.SocketMessages.Message m = new CommonClasses.SocketMessages.Message(CommonClasses.SocketMessages.Message.Status.Input);
             *  INPUT input;
             *  Globals.MasterGlobalVars.ConcurrentQueue.
             *
             *
             * }).Start();*/
        }