BOOL SetForegroundWindow(
HWND hWnd // handle to window to bring to foreground
);
The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.
BOOL BringWindowToTop(
HWND hWnd // handle to window
);
The BringWindowToTop function brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated
procedure ForbidNormalFormMove(AForm: TForm; Msg: TWMWindowPosChanging; Top, Left, Width, Height: Integer);
begin
if (AForm.Top = Top) and (AForm.Left = Left) then
PWindowPos(TMessage(Msg).LParam).flags :=
PWindowPos(TMessage(Msg).LParam).flags or SWP_NOMOVE; //
if ((AForm.Width = Width) or (AForm.Width = 2 * Width)) and (AForm.Height = Height) then
PWindowPos(TMessage(Msg).LParam).flags :=
PWindowPos(TMessage(Msg).LParam).flags or SWP_NOSIZE;
end;