unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
//取得最大化的消息
message WM_GETMINMAXINFO;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo);
begin
inherited;
with Msg.MinMaxInfo^ do
begin
ptMinTrackSize.x:= form1.width;//最小化时的宽度
ptMaxTrackSize.x:= form1.width;//最大化时的宽度
ptMinTrackSize.y:= form1.height;//最小化时的高度
ptMaxTrackSize.y:= form1.height;//最大化时的高度
end;
end;
end.
http://blog.csdn.net/diligentcatrich/article/details/7008785