Author: Mike Shkolnik
How can I disable the any form movement?
Answer:
Always I saw a question: how can I move a window by hit in any part of form?
But I never saw a reverse question: how to disable a movement.
1 type2 TyourForm = class(TForm)
3 private4 { Private declarations }5 procedure WMNCHitTest(varmessage: TWMNCHitTest); message WM_NCHITTEST;
6 end;
7 8 procedure TyourForm.WMNCHitTest(varmessage: TWMNCHitTest);
9 begin10 inherited;
11 12 withmessagedo13 if Result = HTCAPTION then14 Result := HTNOWHERE;
15 end;