procedure OpenForm(FormClass:TFormClass;var fm;AOwner:TComponent);
var i:Integer;
Child:TForm;
begin
try
for i:=0 to Screen.FormCount-1 do
if Screen.Forms[i].ClassType=FormClass then
begin
Child:=Screen.Forms[i];
if Child.WindowState=wsMinimized then
ShowWindow(Child.Handle,3);
if (not Child.Visible) then Child.Visible:=true;
Child.BringToFront;
Child.SetFocus;
TForm(fm):=Child;
exit
end;
Child:=TForm(FormClass.NewInstance);
TForm(fm):=Child;
Child.Create(AOwner);
except
end;
end;