1 2 unit Unit1; 3 4 interface 5 6 uses 7 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 8 Dialogs; 9 10 type 11 TForm1 = class(TForm) 12 private 13 { Private declarations } 14 public 15 { Public declarations } 16 procedure OnPosChange(var Msg: TWmWindowPosChanging); 17 message WM_WINDOWPOSCHANGING; 18 end; 19 20 var 21 Form1: TForm1; 22 23 implementation 24 25 {$R *.dfm} 26 27 { TForm1 } 28 29 procedure TForm1.OnPosChange(var Msg: TWmWindowPosChanging); 30 begin 31 Msg.WindowPos.x := Left; 32 Msg.WindowPos.y := Top; 33 Msg.Result := 0; 34 end; 35 36 end. 37 38