// Declaration: setwindowpos (hwnd: hwnd; {window handle} hwndinsertafter: hwnd; {window Z sequence} X, Y: integer; {location} CX, Cy: integer; {size} uflags: uint {Option}): bool; // optional value of hwndinsertafter parameter: hwnd_top = 0; {before} hwnd_bottom = 1; {behind} hwnd_topmost = hwnd (-1); {front, front of any top window} hwnd_notopmost = hwnd (-2); {front, located behind other top windows} // optional value of uflags parameter: swp_nosize = 1; {ignore CX, Cy, keep size} swp_nomove = 2; {ignore x, y, do not change location} swp_nozorder = 4; {ignore hwndinsertafter and keep Z order} swp_noredraw = 8; {do not redraw} swp_noactivate = $10; {do not activate} swp_framechanged = $20; {force send wm_nccalcsize message. Generally, this message is sent only when it is changed.} swp_showwindow = $40; {display window} swp_hidewindow = $80; {hide window} swp_nocopybits = $100; {discard customer zone} swp_noownerzorder = $200; {ignore hwndinsertafter and do not change the owner of the Z sequence} swp_nosendchanging = $400; {do not send the wm_windowposchanging message} swp_drawframe = swp_frame; {draw border} swp_noreposition = swp_noownerzorder; {} swp_defererase = $2000; {prevent wm_syncpaint message generation} swp_asyncwindowpos = $4000; {if the calling process does not have a window, the system will send requests to threads with Windows}
// Example: Procedure tform1.button1click (Sender: tobject); begin setwindowpos (handle, hwnd_topmost, 100,200, swp_showwindow); end;