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); } }
void OnSize(object sender, SizingAction action) { if (((FrameworkElement)sender).TemplatedParent is Window wnd) { WindowInteropHelper helper = new WindowInteropHelper(wnd); DragSize(helper.Handle, action); } }
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); } }
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); }); } }
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); } }
/// <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); } } }
void OnSize(object sender, SizingAction action) { if (Mouse.LeftButton == MouseButtonState.Pressed) { sender.ForWindowFromTemplate(w => { if (w.WindowState == WindowState.Normal) { DragSize(w.GetWindowHandle(), action); } }); } }
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); } }); } }
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); }
void DragSize(IntPtr handle, SizingAction sizingAction) { SendMessage(handle, WM_SYSCOMMAND, (IntPtr)(SC_SIZE + sizingAction), IntPtr.Zero); SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero); }
private void DragSize(IntPtr handle, SizingAction sizingAction) { SendMessage(handle, WM_SYSCOMMAND, (IntPtr) (SC_SIZE + sizingAction), IntPtr.Zero); SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero); }
static void DragSize(IntPtr handle, SizingAction sizingAction) { SendMessage(handle, WmSyscommand, (IntPtr)(ScSize + sizingAction), IntPtr.Zero); SendMessage(handle, 514, IntPtr.Zero, IntPtr.Zero); }
/// <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); }