User32MoveWindow(IntPtr, Int32, Int32, Int32, Int32, Boolean) Method

Changes the position and dimensions of the specified window.

For a top-level window, the position and dimensions are relative to the upper-left corner of the screen.

For a child window, they are relative to the upper-left corner of the parent window's client area.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool MoveWindow(
	IntPtr hWnd,
	int x,
	int y,
	int width,
	int height,
	bool repaint
)

Parameters

hWnd  IntPtr
A handle to the window.
x  Int32
The new position of the left side of the window.
y  Int32
The new position of the top of the window.
width  Int32
The new width of the window.
height  Int32
The new height of the window.
repaint  Boolean
Indicates whether the window is to be repainted.

If this parameter is , the window receives a message. If the parameter is , no repainting of any kind occurs.

This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving a child window.

Return Value

Boolean
if the function succeeds, otherwise.

Remarks

See Also