procedure TfrmMain.FormCanResize(Sender: TObject; var NewWidth,
NewHeight: Integer; var Resize: Boolean);
begin
if WindowState=wsMinimized then resize:=false else begin
Application.CreateForm(tfrmpass,frmpass);
frmpass.ShowModal;
end;
end;
Procedure TForm1.WMSysCommand(Var Msg : TMessage) ;
begin
if (Msg.WParam = SC_CLOSE) then
begin
.................
end
else if (Msg.WParam = SC_MINIMIZE) then
begin
.............
end
else
inherited;
end ;