SetWindowPos (user32)
Last changed: Ozymandius257-86.25.164.114

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,
   int Y, int cx, int cy, uint uFlags);

VB Signature:

<DllImport("user32.dll", SetLastError:=True)> _
Private Shared Function SetWindowPos(ByVal hWnd As IntPtr, _
                      ByVal hWndInsertAfter As IntPtr, _
                      ByVal X As Integer, _
                      ByVal Y As Integer, _
                      ByVal cx As Integer, _
                      ByVal cy As Integer, _
                      ByVal uFlags As Integer) As Boolean
End Function

VB.NET Signature:

Declare Auto Function SetWindowPos Lib "user32" (ByVal hWnd As IntPtr, _
                      ByVal hWndInsertAfter As IntPtr, _
                      ByVal X As Integer, _
                      ByVal Y As Integer, _
                      ByVal cx As Integer, _
                      ByVal cy As Integer, _
                      ByVal uFlags As Integer) As Boolean

User-Defined Types:

None.

Notes:

When using HWND_TOP as the hWndInsertAfter parameter in order to bring a window to the front of the Z-Order, you must also call SetForegroundWindow.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation