首页 > 开发 > 综合 > 正文

除了使用hook外,下面的代码也能够在全局捕捉鼠标:(csdn)

2020-02-03 13:37:43
字体:
来源:转载
供稿:网友

 dy_2000_abc(芝麻开门)  
public class form1 : system.windows.forms.form,imessagefilter
    {
        private system.windows.forms.button button1;
        static void main()
        {
            application.run(new form1());
        }

        private void form1_load(object sender, system.eventargs e)
        {
        application.addmessagefilter(this);
        }
        public bool prefiltermessage(ref message msg)
        {
            if (msg.msg==0x205)
            {
                this.button1.visible=true;
                return true;
            }
            else
                if (msg.msg==0x201)
            {
            this.button1.visible=false;
                return true;
            }
            else
                return false;
        }
    }
}
  




发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表