コード例 #1
0
ファイル: BlinkBrowser.cs プロジェクト: z5kaosiw/my-demo
        public bool PreFilterMessage(ref Message m)
        {
            //throw new NotImplementedException();
            IntPtr myPtr = BlinkBrowserPInvoke.GetForegroundWindow();

            int           length     = BlinkBrowserPInvoke.GetWindowTextLength(myPtr);
            StringBuilder windowName = new StringBuilder(length + 1);

            BlinkBrowserPInvoke.GetWindowText(myPtr, windowName, windowName.Capacity);
            if (windowName.ToString() == "Miniblink Devtools")
            {
                if (m.Msg == 0x0102 || m.Msg == 0x0100)
                {
                    BlinkBrowserPInvoke.SendMessage(m.HWnd, m.Msg, m.WParam, m.LParam);
                }
            }
            return(false);
        }
コード例 #2
0
        public bool PreFilterMessage(ref Message m)
        {
            IntPtr myPtr = BlinkBrowserPInvoke.GetForegroundWindow();

            int           length     = BlinkBrowserPInvoke.GetWindowTextLength(myPtr);
            StringBuilder windowName = new StringBuilder(length + 1);

            BlinkBrowserPInvoke.GetWindowText(myPtr, windowName, windowName.Capacity);
            if (windowName.ToString() == "Miniblink Devtools")
            {
                int wp = m.WParam.ToInt32();
                if (wp == 13 /*回车*/ || wp == 37 /*左 */ || wp == 39 /*右*/ || wp == 38 /*上*/ || wp == 40 /*下*/)
                {
                    BlinkBrowserPInvoke.SendMessage(m.HWnd, m.Msg, m.WParam, m.LParam);
                }
                if (m.Msg == 258)//字符
                {
                    BlinkBrowserPInvoke.SendMessage(m.HWnd, m.Msg, m.WParam, m.LParam);
                }
            }
            return(false);
        }