~~~~~~~~~~~~~~~~~~~~~~~~~
...
private
procedure WMGetMinMaxInfo
(var msg: TWMGetMinMaxInfo) ;
message WM_GETMINMAXINFO;
...
implementation
procedure TForm1.WMGetMinMaxInfo
(var msg: TWMGetMinMaxInfo) ;
begin
inherited;
with msg.MinMaxInfo^.ptMaxTrackSize do begin
X := GetDeviceCaps(Canvas.Handle, HORZRES)
+ (Width - ClientWidth) ;
Y := GetDeviceCaps(Canvas.Handle, VERTRES)
+ (Height - ClientHeight) ;
end;
end;
procedure TForm1.Button1Click(Sender: TObject) ;
Const
{$J+}
Rect: TRect = (Left:0; Top:0; Right:0; Bottom:0) ;
{$J-}
begin
if Left > 0 then begin
Rect := BoundsRect;
SetBounds(
Left - ClientOrigin.X,
Top - ClientOrigin.Y,
GetDeviceCaps(Canvas.Handle, HORZRES)
+ (Width - ClientWidth),
GetDeviceCaps(Canvas.Handle, VERTRES)
+ (Height - ClientHeight)
) ;
end
else BoundsRect := Rect;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» Left, Mid, Right String
« Capture Maximize/Minimize Menu button click

