// Hiermit kann man
die Ausmaße eines maximierten Fensters selbst bestimmen.
...
procedure FormDblClick(Sender: TObject);
private
procedure minmax(var aMsg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
procedure WMNChittest(var Msg: TWMNChittest); message WM_NCHittest;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
const
obenfrei: integer = 100;
drin: boolean = false;
procedure TForm1.minmax(var aMsg: TWMGetMinMaxInfo);
var r: TRect;
begin
SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);
with aMsg.MinMaxInfo^ do begin
ptMaxPosition.y := obenfrei;
ptMaxSize.y := r.bottom - ptMaxPosition.y;
end;
end;
procedure TForm1.WMNChittest(var msg: TWMNChittest);
begin
DefaultHandler(Msg);
if (Msg.result = HTCAPTION) and (windowstate = wsMaximized)
then begin
Msg.result := HTCLIENT;
drin := true;
end else
drin := false;
end;
procedure TForm1.FormDblClick(Sender: TObject);
begin
if drin and (windowstate = wsMaximized) then windowstate := wsNormal;
end;
|





