Пример #1
0
        internal DpiChangedEventArgs(int old, Message m)
        {
            DeviceDpiOld = old;
            DeviceDpiNew = PARAM.SignedLOWORD(m.WParam);
            Debug.Assert(PARAM.SignedHIWORD(m.WParam) == DeviceDpiNew, "Non-square pixels!");
            RECT suggestedRect = Marshal.PtrToStructure <RECT>(m.LParam);

            SuggestedRectangle = Rectangle.FromLTRB(suggestedRect.left, suggestedRect.top, suggestedRect.right, suggestedRect.bottom);
        }
Пример #2
0
        /// <summary>
        ///  Parameter units are pixels(dots) per inch.
        /// </summary>
        internal unsafe DpiChangedEventArgs(int old, Message m)
        {
            DeviceDpiOld = old;
            DeviceDpiNew = PARAM.SignedLOWORD(m.WParamInternal);
            Debug.Assert(PARAM.SignedHIWORD(m.WParamInternal) == DeviceDpiNew, "Non-square pixels!");
            RECT suggestedRect = *(RECT *)m.LParamInternal;

            SuggestedRectangle = Rectangle.FromLTRB(suggestedRect.left, suggestedRect.top, suggestedRect.right, suggestedRect.bottom);
        }
            private Point GetPositionFromCharIndex(int index)
            {
                if (index < 0 || index >= Text.Length)
                {
                    return(Point.Empty);
                }

                int i = (int)SendMessageW(_owningChildEdit, (WM)EM.POSFROMCHAR, index);

                return(new Point(PARAM.SignedLOWORD(i), PARAM.SignedHIWORD(i)));
            }
Пример #4
0
        public void InitiateWindowDrag(IntPtr hWnd, IntPtr lParam)
        {
            if (_dragWindowInfo != null)
            {
                ReleaseCapture();
                _dragWindowInfo.Reset();

                var dragPoint = new POINT();
                dragPoint.x = PARAM.SignedLOWORD(lParam);
                dragPoint.y = PARAM.SignedHIWORD(lParam);

                var windowTopLeftPoint = new POINT();
                if (_dragWindowInfo.IsCursorInDraggableRegion(ref dragPoint, ref windowTopLeftPoint))
                {
                    SetCapture(hWnd);

                    _dragWindowInfo.DragInitiated      = true;
                    _dragWindowInfo.DragPoint          = dragPoint;
                    _dragWindowInfo.DragWindowLocation = windowTopLeftPoint;

                    InstallDragMouseHook();
                }
            }
        }
Пример #5
0
 public unsafe void SignedLOWORD_x64_Result()
 {
     Assert.Equal((short)0x0304, PARAM.SignedLOWORD(unchecked ((nint)0x0506070801020304)));
     Assert.Equal(unchecked ((short)0xF3F4), PARAM.SignedLOWORD(unchecked ((nint)0xF5F6F7F8F1F2F3F4)));
 }
Пример #6
0
 public unsafe void SignedLOWORD_x32_Result()
 {
     Assert.Equal((short)0x0304, PARAM.SignedLOWORD((nint)0x01020304));
     Assert.Equal(unchecked ((short)0xF3F4), PARAM.SignedLOWORD(unchecked ((nint)0xF1F2F3F4)));
 }