User32SetWindowPos(SafeHandle, IntPtr, Int32, Int32, Int32, Int32, SetWindowPosFlags) Method

Changes the size, position, and Z order of a child, pop-up, or top-level window.

These windows are ordered according to their appearance on the screen.

The topmost window receives the highest rank and is the first window in the Z order.

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 SetWindowPos(
	SafeHandle hWnd,
	IntPtr hWndInsertAfter,
	int x,
	int y,
	int cx,
	int cy,
	SetWindowPosFlags uFlags
)

Parameters

hWnd  SafeHandle
A handle to the window.
hWndInsertAfter  IntPtr
A handle to the window to precede the positioned window in the Z order.
x  Int32
The new position of the left side of the window, in client coordinates.
y  Int32
The new position of the top of the window, in client coordinates.
cx  Int32
The new width of the window, in pixels.
cy  Int32
The new height of the window, in pixels.
uFlags  SetWindowPosFlags
The window sizing and positioning flags.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also