点什么窗体都最小化

private
    procedure WMSysCommand(var Msg:TMessage);message WM_SYSCOMMAND;

procedure TFormMain.WMSysCommand(var Msg: TMessage);
begin
  case Msg.WParam of
    SC_CLOSE,SC_MINIMIZE,SC_MAXIMIZE:
    begin
      Application.Minimize;
    end;
  else inherited;
  end;
end;

原文地址:https://www.cnblogs.com/hnxxcxg/p/2940976.html