unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) private { Private declarations } procedure WMEnterSizeMove(var Message: TMessage) ; message WM_ENTERSIZEMOVE; procedure WMMove(var Message: TMessage) ; message WM_MOVE; procedure WMExitSizeMove(var Message: TMessage) ; message WM_EXITSIZEMOVE; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.WMEnterSizeMove(var Message: TMessage) ; begin Caption:= '正在移动'; end; procedure TForm1.WMMove(var Message: TMessage) ; begin Caption:= Format('移动到 x: %d, y:%d', [TWMMove(Message).XPos,TWMMove(Message).YPos]) ; end; procedure TForm1.WMExitSizeMove(var Message: TMessage) ; begin Caption:= Caption + ' 移动结束' end; end.