コード例 #1
0
ファイル: HookEventHandler.cs プロジェクト: freelsen/rmbhook
        // wow> if you want to eat the mouse event,
        // then must process the MouseDown event, as the wow does.
        public int MouseDown(object sender, MouseEventArgs e)
        {
            if (MouseHelper.misbusy)
            {
                return(0);
            }
            //misbusy = true;
            //WinMon.gtWinMouse();
            //mgesture.ts_dis(e);

            //Point point1 = new Point();
            //point1.X = 0; point1.Y = 0;
            //WinApis.GetCursorPos(ref point1);

            DbMsg.Msg("mouse down," + e.X.ToString() + "," + e.Y.ToString());

            //return 0;
            MouseArgsR er = new MouseArgsR(e.X, e.Y);


            misrdouble = false;
            //Console.WriteLine(e.Button.ToString());
            switch (e.Button)
            {
            case MouseButtons.Left:
                this.onLmouseDown(sender, er);

                //if (mwowman.onLmouseDown(e.X, e.Y))
                //    ishandled = true;

                //mMouseEHandler.OnLDown(ref misrdouble);
                //if (misrdouble)
                //{
                //    mwowman.onLDouble();
                //}

                break;

            case MouseButtons.Right:
                this.onRmouseDown(sender, er);
                //if (mwowman.onRmouseDown(e.X, e.Y))
                //    ishandled = false;

                break;

            case MouseButtons.Middle:
                mMouseEHandler.OnMDown();
                break;
            }

            //mform.onMouseEvent("MouseDown", e.Button.ToString(),
            //    e.X.ToString(), e.Y.ToString(), "");
            bool ishandled = er.ishandled;
            int  ret       = ((ishandled) && !miskeydown) ? 1 : 0;

            DbMsg.Msg("ret=" + ret.ToString() + "," + miskeydown.ToString());
            return(ret);
        }
コード例 #2
0
ファイル: DfEvent.cs プロジェクト: freelsen/rmbhook
 void Bind2Wow()
 {
     if (_wowwin.FindWin())
     {
         DbMsg.Msg("target win found");
         WinApis.MoveWindow(mdrawform.Handle,
                            _wowwin.mposition.X, _wowwin.mposition.Y
                            , _wowwin.mrect.right - _wowwin.mrect.left,
                            _wowwin.mrect.bottom - _wowwin.mrect.top,
                            true);
     }
 }
コード例 #3
0
        public void OnSize(Rectangle rc)
        {
            //Point point = new Point(rc.Width / 2, rc.Height / 2);

            if (mclientlast.X == rc.X && mclientlast.Y == rc.Y)
            {
                return;
            }
            else
            {
                mclientlast = rc;
            }

            DbMsg.Msg("new size=" + rc.Width.ToString() + "," + rc.Height.ToString());

            this.onSizeChanged(rc);
        }
コード例 #4
0
ファイル: HookEventHandler.cs プロジェクト: freelsen/rmbhook
        public void KeyUp(object sender, KeyEventArgs e)
        {
            if (KeyHelper.miskeybusy)
            {
                return;
            }

            //mbusycnt--;

            miskeydown = false;
            DbMsg.Msg("keydown=" + miskeydown.ToString());

            mistabdown = false;
            //mform.onKeyboardEvent("KeyUp", e.KeyCode.ToString(), "",
            //    e.Shift.ToString(), e.Alt.ToString(), e.Control.ToString());

            //if (mrmbkey.onKeymsg(e) > 0)
            //    e.Handled = true;
        }
コード例 #5
0
ファイル: HookEventHandler.cs プロジェクト: freelsen/rmbhook
        public int MouseUp(object sender, MouseEventArgs e)
        {
            if (MouseHelper.misbusy)
            {
                return(0);
            }
            DbMsg.Msg("mouse up," + e.X.ToString() + "," + e.Y.ToString());
            //return 0;
            //mform.onMouseEvent("MouseUp", e.Button.ToString(),
            //    e.X.ToString(), e.Y.ToString(), "");

            //Point point = new Point();
            //point.X = 0; point.Y = 0;
            //WinApis.GetCursorPos(ref point);
            //Console.WriteLine("mouse up," + point.X.ToString() + "," + point.Y.ToString());

            MouseArgsR er = new MouseArgsR(e.X, e.Y);

            switch (e.Button)
            {
            case MouseButtons.Left:
                mMouseEHandler.OnLUp();
                break;

            case MouseButtons.Right:
                mMouseEHandler.OnRUp();


                mMouseEHandler.OnRDown(ref misrdouble);
                if (misrdouble)
                {
                    //mwowman.onRDouble();
                    this.onRmouseDouble(sender, er);
                }

                break;

            case MouseButtons.Middle:
                mMouseEHandler.OnMDown();
                break;
            }
            return(0);
        }
コード例 #6
0
        public void OnParint(Graphics grap)
        {
            this.onPaint(grap);
            //mdwgraph.drawCircle(grap);
            //mdw3by3.drawGraph(grap);

            //
            Point pt = new Point(0, 0);

            if (DrawForm.mthis != null)
            {
                pt.X = 0; pt.Y = 0;
                WinApis.ClientToScreen(DrawForm.mthis.Handle, ref pt);
                DbMsg.Msg("drawform=" + pt.X.ToString() + "," + pt.Y.ToString());

                pt.X = 0; pt.Y = 0;
                WinApis.ClientToScreen(WowWin.mthis._hWnd, ref pt);
                DbMsg.Msg("target=" + pt.X.ToString() + "," + pt.Y.ToString());
            }
        }
コード例 #7
0
ファイル: WowWin.cs プロジェクト: freelsen/rmbhook
        public bool FindWin()
        {
            IntPtr hwndtarget = (IntPtr)null;

            hwndtarget = WinApis.FindWindow(null, mwinname);

            if (hwndtarget != (IntPtr)null)
            {
                DbMsg.Msg("target win handle=" + hwndtarget.ToString("x"));
                _hWnd          = hwndtarget;
                mhwnd          = (int)hwndtarget;
                mistargetfound = true;
            }
            else
            {
                return(false);
            }

            return(UpdateInfo());
        }
コード例 #8
0
ファイル: WowEvent.cs プロジェクト: freelsen/rmbhook
        bool onLmouseDown(int x, int y)
        {
            //int x = e.X;
            //int y = e.Y;

            bool ishandle = false;

            Point pt = new Point(x, y);

            WinApis.ScreenToClient(mdfman.mformhwnd, ref pt);

            int idx = mdw3by3.getGridIndex(pt.X, pt.Y);

            if (idx > -1 && idx < 9)
            {
                if (idx == 6)
                {
                    mdfman.mdrawform.setTimer();
                    mdw3by3.setColor(idx);
                    mdfman._formclientevent.OnParint();

                    ishandle = true;
                }
                else if (idx == 7)
                {
                    //mdwgraph.changeColor();
                    misshowpos = !misshowpos;

                    ishandle = true;
                }
                else
                {
                    mwowcmd.doCmd(idx);
                    ishandle = true;
                }

                DbMsg.Msg("cmd=" + idx.ToString());
            }

            return(ishandle);
        }
コード例 #9
0
ファイル: WowWin.cs プロジェクト: freelsen/rmbhook
        bool UpdateInfo()
        {
            //_targetpos = new Point();
            mposition.X = 0; mposition.Y = 0;
            bool found = WinApis.ClientToScreen(_hWnd, ref mposition);

            if (found)
            {
                //WinApis.RECT _rect;
                WinApis.GetClientRect(_hWnd, out mrect);

                mclientcenter.X = (mrect.right - mrect.left) / 2;
                mclientcenter.Y = (mrect.bottom - mrect.top) / 2;

                mclient.X      = mposition.X;
                mclient.Y      = mposition.Y;
                mclient.Width  = mrect.right - mrect.left;
                mclient.Height = mrect.bottom - mrect.top;

                DbMsg.Msg(mposition.X.ToString() + "," + mposition.Y.ToString());
            }

            return(found);
        }
コード例 #10
0
 public void setTimer()
 {
     timer1.Enabled = !timer1.Enabled;
     DbMsg.Msg("timer1=" + timer1.Enabled.ToString());
 }