WM_WINDOWPOSCHANGING ist die Antwort.
Delphi-Quellcode:
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 =
class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
Procedure WMWindowPosChanging(
Var Message: TWMWindowPosChanging);
Message WM_WINDOWPOSCHANGING;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
{ TForm1 }
procedure TForm1.WMWindowPosChanging(
var Message: TWMWindowPosChanging);
begin
With Message Do
Begin
WindowPos.x := 0;
// Left
WindowPos.y := 0;
// Top
WindowPos.cx := 1280;
// Width
WindowPos.cy := 1024;
// Height
Result := 0;
// handled
End;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Left := 0;
// nur dazu da, die Form einmalig in den Verschiebungsprozess zu bekommen
end;
end.