procedure Tmain.OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
var
i:integer;
Child:TForm;
begin
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,SW_SHOWMAXIMIZED)
else
ShowWindow(Child.handle,SW_SHOWMAXIMIZED);
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);
ShowWindow(Child.handle,SW_SHOWMAXIMIZED);
end;
各位高手帮小弟看看下面这段代码的意思吧!(红色部分)