procedure OpenForm(FormClass: TFormClass; var Frm);
var
I:Integer;
Child: TForm;
begin
for I:=0 to Screen.FormCount-1 do
if Screen.Forms.ClassType =FormClass then
begin
Child:=Screen.Forms;
if Child.WindowState=wsMinimized then
ShowWindow(Child.Handle, SW_ShowNormal)
else
ShowWindow(Child.Handle, SW_ShowNA);
if (Not Child.Visible) then
Child.Visible:=True;
Child.BringToFront;
Child.SetFocus;
TForm(Frm):=Child;
Exit;
end;
Child:=TForm(FormClass.NewInstance);
TForm(Frm):=Child;
Child.Create(Application);
end;