示例#1
0
            /// <summary>
            /// マウスのフックプロシージャ
            /// </summary>
            /// <param name="nCode">フックコード</param>
            /// <param name="msg">フックプロシージャに渡す値</param>
            /// <param name="s">フックプロシージャに渡す値</param>
            /// <returns>フックチェーン内の次のフックプロシージャの戻り値</returns>
            private System.IntPtr MouseHookProcedure(
                int nCode,
                uint msg,
                ref MSLLHOOKSTRUCT s
                )
            {
                try
                {
                    if (0 <= nCode)
                    {
                        switch (msg)
                        {
                        case 0x0202:            // WM_LBUTTONUP
                            if (MouseLeftUpStop)
                            {
                                StopWindowSelection();
                                MouseLeftButtonUp?.Invoke(this, new MouseLeftButtonUpEventArgs());
                            }
                            break;

                        case 0x0200:          // WM_MOUSEMOVE
                            FrameWindowProcessing();
                            break;
                        }
                    }
                }
                catch
                {
                }

                return(NativeMethods.CallNextHookEx(Handle, nCode, msg, ref s));
            }
示例#2
0
        private void InitMouseEvents()
        {
            _circle.MouseEnter           += (s, e) => MouseEnter?.Invoke(this, e);
            _circle.MouseLeave           += (s, e) => MouseLeave?.Invoke(this, e);
            _circle.MouseLeftButtonDown  += (s, e) => MouseLeftButtonDown?.Invoke(this, e);
            _circle.MouseLeftButtonUp    += (s, e) => MouseLeftButtonUp?.Invoke(this, e);
            _circle.MouseRightButtonDown += (s, e) => MouseRightButtonDown?.Invoke(this, e);
            _circle.MouseRightButtonUp   += (s, e) => MouseRightButtonUp?.Invoke(this, e);
            _circle.MouseMove            += (s, e) => MouseMove?.Invoke(this, e);

            _label.UILabel.MouseEnter           += (s, e) => MouseEnter?.Invoke(this, e);
            _label.UILabel.MouseLeave           += (s, e) => MouseLeave?.Invoke(this, e);
            _label.UILabel.MouseLeftButtonDown  += (s, e) => MouseLeftButtonDown?.Invoke(this, e);
            _label.UILabel.MouseLeftButtonUp    += (s, e) => MouseLeftButtonUp?.Invoke(this, e);
            _label.UILabel.MouseRightButtonDown += (s, e) => MouseRightButtonDown?.Invoke(this, e);
            _label.UILabel.MouseRightButtonUp   += (s, e) => MouseRightButtonUp?.Invoke(this, e);
            _label.UILabel.MouseMove            += (s, e) => MouseMove?.Invoke(this, e);
        }
示例#3
0
 void FireMouseLeftButtonUp(object sender, PointerRoutedEventArgs e)
 {
     MouseLeftButtonUp?.Invoke(sender, e);
 }
 protected void OnMouseLeftButtonUp(MouseButtonEventArgs e)
 {
     MouseLeftButtonUp?.Invoke(this, e.ToMouseButtonEventArgsInt(MouseButton.Left, MouseButtonState.Released));
 }