As I found, the window will move to the "negative" place, but then bounce back. To prevent this, you can do something like:
public partial class Window1: Window { public Window1() { InitializeComponent(); } private void Window_MouseDown(object sender, MouseButtonEventArgs e) { DragMove(); } public struct WINDOWPOS { public IntPtr hwnd; public IntPtr hwndInsertAfter; public int x; public int y; public int cx; public int cy; public UInt32 flags; }; private static IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { switch(msg) { case 0x46:
Processing WM_WINDOWPOSCHANGING this way will prevent any window movement if the left mouse button is not pressed. This includes maximizing the window and programmatically changing the position of the window, so you have to adapt the code if you need other behavior.
source share