private
procedure WMSysCommand(var Msg:TMessage);message WM_SYSCOMMAND;
procedure TForm1.WMSysCommand(var Msg: TMessage);
begin
case Msg.WParam of
SC_MINIMIZE : ShowMessage( '最小化 ');
SC_MAXIMIZE : ShowMessage( '最大化 ');
end;
inherited;
end;