Unit ubaseform;
Interface
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs;
Type
Tpoint = record
X: integer;
Y: integer;
End;
Tminmaxinfo = record
Ptreserved: tpoint;
Ptmaxsize: tpoint;
Ptmaxposition: tpoint;
Ptmintracksize: tpoint;
Ptmaxtracksize: tpoint;
End;
Twmgetminmaxinfo = record
MSG: Cardinal;
Unused: integer;
Minmaxinfo: pminmaxinfo;
Result: longint;
End;
Tbaseform = Class (tform)
Procedure formclose (Sender: tobject; var action: tcloseaction );
Private
Procedure wmgetminmaxinfo (VAR message: twmgetminmaxinfo); message wm_getminmaxinfo;
End;
VaR
Baseform: tbaseform;
Implementation
{$ R *. DFM}
Procedure tbaseform. formclose (Sender: tobject; var action: tcloseaction );
Begin
Action: = cafree;
End;
Procedure tbaseform. wmgetminmaxinfo (VAR message: twmgetminmaxinfo );
Begin
With message. minmaxinfo ^ do
Begin
// Ptmaxsize. X: = screen. width; {width when maximized}
// Ptmaxsize. Y: = 200; {height when maximized}
Ptmaxposition. X: = 0; {left position when maximized}
Ptmaxposition. Y: = application. mainform. height; {top position when maximized}
// Ptmintracksize. x := 100; {minimum width}
// Ptmintracksize. y := 100; {minimum height}
Ptmaxtracksize. X: = screen. width; {maximum width}
Ptmaxtracksize. Y: = screen. Height-application. mainform. Height-25; {maximum height}
End;
Message. Result: = 0; {tell windows you have changed minmaxinfo}
Inherited;
End;
End.