Exemple #1
0
        /// <summary>
        /// 半后台绑定,不锁定鼠标输入
        /// </summary>
        public bool BindHalfBackground()
        {
            bool isMin = IsMin;

            if (IsBind)
            {
                if (BindType == WindowBindType.Half)
                {
                    return(true);
                }
                UnBind();
            }
            RestoreAndNotActive();
            int dmRet;

            if (Dm.IsFree)
            {
                dmRet = Dm.BindWindow(_hwnd, DmBindDisplay.dx, DmBindMouse.dx2, DmBindKeypad.dx, DmBindMode._0);
            }
            else
            {
                dmRet = Dm.BindWindowEx(
                    _hwnd,
                    "dx2",
                    "dx.mouse.position.lock.api|dx.mouse.focus.input.api|dx.mouse.focus.input.message|dx.mouse.clip.lock.api|dx.mouse.input.lock.api|dx.mouse.state.api|dx.mouse.api|dx.mouse.cursor",
                    "dx.keypad.input.lock.api|dx.keypad.state.api|dx.keypad.api",
                    "dx.public.active.api|dx.public.active.message",
                    DmBindMode._4);
            }
            if (dmRet == 0)
            {
                IsBind   = false;
                BindType = WindowBindType.None;
                return(false);
            }
            BindType = WindowBindType.Half;
            IsBind   = true;
            if (isMin)
            {
                Min();
            }
            return(true);
        }
 /// <summary>
 /// 前台绑定,独占鼠标
 /// </summary>
 public bool BindNormal()
 {
     if (IsBind)
     {
         if (BindType == WindowBindType.Normal)
         {
             return true;
         }
         UnBind();
     }
     bool dmRet = Dm.BindWindow(_hwnd, DmBindDisplay.normal, DmBindMouse.normal, DmBindKeypad.normal, DmBindMode._0);
     if (dmRet)
     {
         IsBind = false;
         BindType = WindowBindType.None;
         return false;
     }
     BindType = WindowBindType.Normal;
     IsBind = true;
     return true;
 }
Exemple #3
0
        /// <summary>
        /// 全后台绑定,锁定鼠标输入
        /// </summary>
        public bool BindFullBackground()
        {
            if (IsBind)
            {
                if (BindType == WindowBindType.Full)
                {
                    return(true);
                }
                UnBind();
            }
            RestoreAndNotActive();
            int dmRet = Dm.BindWindow(_hwnd, DmBindDisplay.dx, DmBindMouse.dx, DmBindKeypad.dx, DmBindMode._0);

            if (dmRet == 0)
            {
                IsBind   = false;
                BindType = WindowBindType.None;
                return(false);
            }
            BindType = WindowBindType.Full;
            IsBind   = true;
            return(true);
        }
Exemple #4
0
        /// <summary>
        /// 全后台绑定,锁定鼠标输入
        /// </summary>
        public bool BindFullBackground()
        {
            if (IsBind)
            {
                if (BindType == WindowBindType.Full)
                {
                    return(true);
                }
                UnBind();
            }
            RestoreAndNotActive();
            bool dmRet;

            if (Dm.IsFree)
            {
                dmRet = Dm.BindWindow(_hwnd, DmBindDisplay.dx, DmBindMouse.dx, DmBindKeypad.dx, DmBindMode._0);
            }
            else
            {
                dmRet = Dm.BindWindowEx(
                    _hwnd,
                    "dx2",
                    "dx.mouse.position.lock.api|dx.mouse.position.lock.message|dx.mouse.clip.lock.api|dx.mouse.input.lock.api|dx.mouse.state.api|dx.mouse.api|dx.mouse.cursor",
                    "dx.keypad.input.lock.api|dx.keypad.state.api|dx.keypad.api",
                    "dx.public.active.api|dx.public.active.message",
                    DmBindMode._4);
            }
            if (dmRet)
            {
                IsBind   = false;
                BindType = WindowBindType.None;
                return(false);
            }
            BindType = WindowBindType.Full;
            IsBind   = true;
            return(true);
        }
Exemple #5
0
        /// <summary>
        /// 半后台绑定,不锁定鼠标输入
        /// </summary>
        public bool BindHalfBackgroundMoniqi()
        {
            bool isMin = IsMin;

            if (IsBind)
            {
                if (BindType == WindowBindType.Half)
                {
                    return(true);
                }
                UnBind();
            }
            RestoreAndNotActive();
            bool dmRet;

            if (Dm.IsFree)
            {
                dmRet = Dm.BindWindow(_hwnd, DmBindDisplay.dx, DmBindMouse.dx2, DmBindKeypad.dx, DmBindMode._0);
            }
            else
            {
                dmRet = Dm.BindWindowEx(_hwnd, "dx.graphic.opengl", "windows", "windows", "dx.public.graphic.protect|dx.public.anti.api|dx.public.input.ime", 0);
            }
            if (!dmRet)
            {
                IsBind   = false;
                BindType = WindowBindType.None;
                return(false);
            }
            BindType = WindowBindType.Half;
            IsBind   = true;
            if (isMin)
            {
                Min();
            }
            return(true);
        }