Exemplo n.º 1
0
        /// <summary>
        /// 安装钩子
        /// </summary>
        private void StartHook()
        {
            Hooker.Start();

            //if (Hooker.hMouseHook == 0)
            //{
            //    Hooker.hMouseHook = Hooker.SetWindowsHookEx(Hooker.WH_MOUSE_LL, Hooker.MouseHookProcedure, Hooker.GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName), 0);
            //    if (Hooker.hMouseHook == 0)
            //    {//如果设置钩子失败.

            //        this.StopHook();
            //        MessageBox.Show("Set windows hook failed!");
            //    }
            //}
        }