unit Unit1;
interface
uses
; Windows, Messages, Forms;
type
; TForm1 = class(TForm)
; ; procedure FormCreate(Sender: TObject);
; protected
; ; LastX: Integer;
; ; procedure WMMoving(var Message: TMessage); message WM_MOVING;
; ; procedure WMMove(var Message: TWMMouse); message WM_MOVE;
; end;
var
; Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
; LastX := Left;
end;
procedure TForm1.WMMoving(var Message: TMessage);
var
; R: TRect;
begin
; with Message do begin
; ; R := PRect(lParam)^;
; ; if (R.Left < 30) and (R.Left < LastX) then begin
; ; ; OffSetRect(R, -R.Left, 0);
; ; ; CopyRect(PRect(lParam)^, R);
; ; ; Result := 1;
; ; end else inherited;
; ; LastX := R.Left;
; end;
end;
procedure TForm1.WMMove(var Message: TWMMouse);
begin
; inherited;
; if Left < 30 then Left := 0;
end;
end.