unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;type
  TForm1 = class(TForm)
  private
    { Private declarations }
  protected
    procedure OnPosChange(var Msg: TWmWindowPosChanging);
              message WM_WINDOWPOSCHANGING;  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.DFM}
procedure TForm1.OnPosChange (var Msg: TWmWindowPosChanging);
begin
  Msg.WindowPos.x := Form1.Left;
//消息的WindowPos.x部分包含新窗体左边位置,将其改成原来窗体左边坐标
//Left全写为Form1.Left
  Msg.WindowPos.y := Form1.Top;
//消息的WindowPos.y部分包含新窗体顶部位置,将其改成原来窗体顶部坐标
//Top全写为Form1.Top
  Msg.Result := 0;
end;
end.
绝对 Delphi菜鸟,