Exemple #1
0
        internal static IntPtr ApplicationMessageFilter(
            IntPtr hwnd, int message, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            // Handle messages passed to the visual.
            switch (message)
            {
            // Handle the left and right mouse button up messages.
            case WM_LBUTTONUP:
            case WM_RBUTTONUP:
                System.Windows.Point pt = new System.Windows.Point();
                pt.X = (uint)lParam & (uint)0x0000ffff;      // LOWORD = x
                pt.Y = (uint)lParam >> 16;                   // HIWORD = y
                MyShape.OnHitTest(pt, message);
                break;
            }

            return(IntPtr.Zero);
        }
Exemple #2
0
        internal static IntPtr ApplicationMessageFilter(
            IntPtr hwnd, int message, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            // Handle messages passed to the visual.
            switch (message)
            {
            // Handle the left and right mouse button up messages.
            case WmLbuttonup:
            case WmRbuttonup:
                var pt = new Point
                {
                    X = (uint)lParam & 0x0000ffff,
                    Y = (uint)lParam >> 16
                };
                // LOWORD = x
                // HIWORD = y
                MyShape.OnHitTest(pt, message);
                break;
            }

            return(IntPtr.Zero);
        }