TForm1 = class(TForm)
  private
    { Private declarations }
    procedure WMMoving(var Msg: TMessage); message WM_MOVING;
  public
    { Public declarations }
  end;procedure TForm1.WMMoving(var Msg: TMessage);
var
P: PRect;
begin
inherited;  P := PRect(Msg.LParam);
  P^.Left := 0;
  P^.Top := 0;
  P^.Right := 640;
  P^.Bottom := 480;
end;