void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     if (System.Windows.Input.Mouse.LeftButton == System.Windows.Input.MouseButtonState.Pressed) {
         SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero);
         SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
     }
 }
示例#2
0
 void OnSize(object sender, SizingAction action)
 {
     if (((FrameworkElement)sender).TemplatedParent is Window wnd)
     {
         WindowInteropHelper helper = new WindowInteropHelper(wnd);
         DragSize(helper.Handle, action);
     }
 }
示例#3
0
 void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     if (System.Windows.Input.Mouse.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
     {
         SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero);
         SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
     }
 }
示例#4
0
 private void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed)
     {
         SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero);
         SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
     }
 }
示例#5
0
        void OnSize(object sender, SizingAction diraction)
        {
            WindowInteropHelper helper = GetHelper(sender);

            if (helper != null)
            {
                DragSize(helper.Handle, diraction);
            }
        }
 void OnSize(object sender, SizingAction action)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed) {
         sender.ForWindowFromTemplate(w => {
                 if (w.WindowState == WindowState.Normal)
                     DragSize(w.GetWindowHandle(), action);
             });
     }
 }
示例#7
0
        public static void DragSize(this System.Windows.Window source, SizingAction direction)
        {
            IntPtr handle = new WindowInteropHelper(source).Handle;

            if (Mouse.LeftButton == MouseButtonState.Pressed)
            {
                WinApi.SendMessage(handle, WinApi.WM_SYSCOMMAND, (int)WinApi.SC_SIZE + (int)direction, 0);
                WinApi.SendMessage(handle, 514, 0, 0);
            }
        }
        public static void DragSize(this System.Windows.Window source, SizingAction direction)
        {
            IntPtr handle = new WindowInteropHelper(source).Handle;

            if (Mouse.LeftButton == MouseButtonState.Pressed)
            {
                WinApi.SendMessage(handle, WinApi.WM_SYSCOMMAND, (int)WinApi.SC_SIZE + (int)direction, 0);
                WinApi.SendMessage(handle, 514, 0, 0);
            }
        }
示例#9
0
 /// <summary>
 /// Switch to resize mode by dragging corners
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="action"></param>
 protected void p_OnSize(object sender, SizingAction action)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed)
     {
         var w = p_GetTemplatedWindow(sender);
         if (w != null && w.WindowState == WindowState.Normal)
         {
             p_DragSize(p_GetHW(w), action);
         }
     }
 }
示例#10
0
 void OnSize(object sender, SizingAction action)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed)
     {
         sender.ForWindowFromTemplate(w => {
             if (w.WindowState == WindowState.Normal)
             {
                 DragSize(w.GetWindowHandle(), action);
             }
         });
     }
 }
示例#11
0
 void OnSize(object sender, SizingAction action)
 {
     if (Mouse.LeftButton == MouseButtonState.Pressed)
     {
         ForWindowFromTemplate(sender, w =>
         {
             if (w.WindowState == WindowState.Normal && w.ResizeMode != ResizeMode.NoResize)
             {
                 DragSize(GetWindowHandle(w), action);
             }
         });
     }
 }
示例#12
0
 private void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     NativeMethods.SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero);
     NativeMethods.SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }
示例#13
0
 void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero);
     SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }
示例#14
0
 private void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     SendMessage(handle, WM_SYSCOMMAND, (IntPtr) (SC_SIZE + sizingAction), IntPtr.Zero);
     SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }
示例#15
0
 static void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     SendMessage(handle, WmSyscommand, (IntPtr)(ScSize + sizingAction), IntPtr.Zero);
     SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }
示例#16
0
 /// <summary>
 /// Activate resize mode
 /// </summary>
 /// <param name="handle"></param>
 /// <param name="sizing_action"></param>
 private void p_DragSize(IntPtr handle, SizingAction sizing_action)
 {
     p_SendMessage(handle, WmSyscommand, (IntPtr)(ScSize + sizing_action), IntPtr.Zero);
     p_SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }
示例#17
0
 static void DragSize(IntPtr handle, SizingAction sizingAction)
 {
     SendMessage(handle, WmSyscommand, (IntPtr)(ScSize + sizingAction), IntPtr.Zero);
     SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero);
 }