Definition: [DllImport ("User32.dll")]
public static extern bool SetWindowPos (IntPtr hWnd, int hwndlnsertafter, int X, int Y, int cx, int cy, uint Flags);
Call: Api.setwindowpos (Mainhwnd,-1, 0, 0, 0, 0, 0x001 | 0x002 | 0x040);
Parameters:
Hwndinsertafter Window Overlay Position
Hwnd_topmost = 1 "top layer" above the "normal layer" used
Hwnd_top =0 on the top floor of the "normal layer"
Hwnd_bottom =1 at the bottom of the "normal layer"
hwnd_notopmost=-2 "normal layer" on all non-"normal" layers
uflags Additional Parameters
Swp_nosize =0x0001 window size unchanged (ignoring cx,cy parameters)
Swp_nomove =0x0002 non-removable window (ignore x, y parameter)
Swp_nozorder =0x0004 does not change the stacking order (ignoring the hwndinsertafter parameter)
Swp_noredraw =0x0008 do not repaint the window
Swp_noactivate =0x0010 do not activate the window
Swp_drawframe =0x0020 window with border, send border change message
Swp_showwindow =0x0040 Display window
Swp_hidewindow =0x0080 window Hidden
Swp_nocopybits =0x0100 do not keep copies of the display cache
Swp_noownerzorder =0x0200 does not change the parent window stacking order
Swp_nosendchanging =0x0400 does not accept messages for window position changes
Note: If you want to use more than one of the above uflags parameters, simply add and assign several parameters to the uflags.
2015.4.21 SetWindowPos Function usage