I have a problem with my custom window (AllowTransparency, WindowStyle=None) in WPF. DragMove() method works good, but when I maximize window, or it maximizing automatically
The DragMove() method only works in the titlebar of the form so use:
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam);
public static void StartDrag(Window window)
{
WindowInteropHelper helper = new WindowInteropHelper(window);
SendMessage(helper.Handle, 161, 2, 0);
}
Dont forget to add System.Windows.Interop