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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function SetWindowPos (
hWnd As SafeHandle,
hWndInsertAfter As IntPtr,
x As Integer,
y As Integer,
cx As Integer,
cy As Integer,
uFlags As SetWindowPosFlags
) As Boolean
Dim hWnd As SafeHandle
Dim hWndInsertAfter As IntPtr
Dim x As Integer
Dim y As Integer
Dim cx As Integer
Dim cy As Integer
Dim uFlags As SetWindowPosFlags
Dim returnValue As Boolean
returnValue = User32.SetWindowPos(hWnd,
hWndInsertAfter, x, y, cx, cy, uFlags)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool SetWindowPos(
SafeHandle^ hWnd,
IntPtr hWndInsertAfter,
int x,
int y,
int cx,
int cy,
SetWindowPosFlags uFlags
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member SetWindowPos :
hWnd : SafeHandle *
hWndInsertAfter : IntPtr *
x : int *
y : int *
cx : int *
cy : int *
uFlags : SetWindowPosFlags -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.